rhythmbox r6013 - in trunk: . podcast



Author: jmatthew
Date: Thu Nov  6 12:26:12 2008
New Revision: 6013
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6013&view=rev

Log:
2008-11-06  Jonathan Matthew  <jonathan d14n org>

	* podcast/rb-podcast-manager.h: Fix signal prototype

	* podcast/rb-podcast-parse.c: (rb_podcast_parse_load_feed):
	* podcast/rb-podcast-parse.h:
	If a feed parses correctly, but contains no downloadable items, report
	it as an error.  Fixes #452512.


Modified:
   trunk/ChangeLog
   trunk/podcast/rb-podcast-manager.h
   trunk/podcast/rb-podcast-parse.c
   trunk/podcast/rb-podcast-parse.h

Modified: trunk/podcast/rb-podcast-manager.h
==============================================================================
--- trunk/podcast/rb-podcast-manager.h	(original)
+++ trunk/podcast/rb-podcast-manager.h	Thu Nov  6 12:26:12 2008
@@ -61,7 +61,7 @@
     void        (*start_download)    		(RBPodcastManager* pd, RhythmDBEntry *entry);
     void        (*finish_download)   		(RBPodcastManager* pd, RhythmDBEntry *entry);
     void        (*feed_updates_available)   	(RBPodcastManager* pd, RhythmDBEntry *entry);
-    void        (*process_error)	   	(RBPodcastManager* pd, const char *error);
+    gboolean    (*process_error)	   	(RBPodcastManager* pd, const char *error, gboolean existing);
 
 } RBPodcastManagerClass;
 

Modified: trunk/podcast/rb-podcast-parse.c
==============================================================================
--- trunk/podcast/rb-podcast-parse.c	(original)
+++ trunk/podcast/rb-podcast-parse.c	Thu Nov  6 12:26:12 2008
@@ -211,6 +211,19 @@
 		g_object_unref (plparser);
 		return FALSE;
 	}
+	g_object_unref (plparser);
+
+	/* treat empty feeds, or feeds that don't contain any downloadable items, as
+	 * an error.
+	 */
+	if (data->posts == NULL) {
+		rb_debug ("Parsing %s as a podcast succeeded, but the feed contains no downloadable items", file_name);
+		g_set_error (error,
+			     RB_PODCAST_PARSE_ERROR,
+			     RB_PODCAST_PARSE_ERROR_NO_ITEMS,
+			     _("The feed does not contain any downloadable items"));
+		return FALSE;
+	}
 
 	rb_debug ("Parsing %s as a Podcast succeeded", file_name);
 	return TRUE;

Modified: trunk/podcast/rb-podcast-parse.h
==============================================================================
--- trunk/podcast/rb-podcast-parse.h	(original)
+++ trunk/podcast/rb-podcast-parse.h	Thu Nov  6 12:26:12 2008
@@ -36,7 +36,8 @@
 {
 	RB_PODCAST_PARSE_ERROR_FILE_INFO,		/* error getting podcast file info */
 	RB_PODCAST_PARSE_ERROR_MIME_TYPE,		/* podcast has unexpected mime type */
-	RB_PODCAST_PARSE_ERROR_XML_PARSE		/* error parsing podcast xml */
+	RB_PODCAST_PARSE_ERROR_XML_PARSE,		/* error parsing podcast xml */
+	RB_PODCAST_PARSE_ERROR_NO_ITEMS,		/* feed doesn't contain any downloadable items */
 } RBPodcastParseError;
 
 #define RB_PODCAST_PARSE_ERROR rb_podcast_parse_error_quark ()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]