RSSyl: Accept feeds with no title. Closes bug #3480.
authorAndrej Kacian <andrej@kacian.sk>
Mon, 19 Oct 2015 14:53:32 +0000 (16:53 +0200)
committerAndrej Kacian <andrej@kacian.sk>
Mon, 19 Oct 2015 14:53:32 +0000 (16:53 +0200)
src/plugins/rssyl/rssyl_update_feed.c

index 8e8b964..398a642 100644 (file)
@@ -134,9 +134,7 @@ void rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose)
 
                ctx->success = FALSE;
        } else {
 
                ctx->success = FALSE;
        } else {
-               if( feed_get_title(ctx->feed) == NULL ) {
-                       /* libcurl was happy, but libfeed wasn't */
-                       debug_print("RSSyl: Error reading feed\n");
+               if( ctx->feed == NULL ) {
                        if( verbose ) {
                                gchar *msg = g_markup_printf_escaped(
                                                (const char *) _("No valid feed found at\n<b>%s</b>"),
                        if( verbose ) {
                                gchar *msg = g_markup_printf_escaped(
                                                (const char *) _("No valid feed found at\n<b>%s</b>"),
@@ -149,6 +147,11 @@ void rssyl_fetch_feed(RFetchCtx *ctx, gboolean verbose)
                                        feed_get_url(ctx->feed));
 
                        ctx->success = FALSE;
                                        feed_get_url(ctx->feed));
 
                        ctx->success = FALSE;
+               } else if (feed_get_title(ctx->feed) == NULL) {
+                       /* We shouldn't do this, since a title is mandatory. */
+                       feed_set_title(ctx->feed, _("Untitled feed"));
+                       log_print(LOG_PROTOCOL, _("Possibly invalid feed without title at %s.\n"),
+                                               feed_get_url(ctx->feed));
                }
        }
 }
                }
        }
 }