diff options
author | Bastien Nocera <hadess@hadess.net> | 2007-11-06 11:16:58 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2007-11-06 11:16:58 +0000 |
commit | dd9519f373e1b25bec36e0735da1293f2d171ce2 (patch) | |
tree | 25cc5f92033bf82b6afaea628c1c0423d66794b0 | |
parent | f1171f6a18734fa991a65478198c3117039bff61 (diff) | |
download | totem-dd9519f373e1b25bec36e0735da1293f2d171ce2.tar.gz |
Look for the feed metadata first, as it might be at the end of the file
2007-11-06 Bastien Nocera <hadess@hadess.net>
* src/plparse/totem-pl-parser-podcast.c: (parse_rss_items),
(totem_pl_parser_add_rss): Look for the feed metadata first,
as it might be at the end of the file (fixes parsing of
http://www.pinksilver.net/podcast/feed.xml, thanks Jonathan for
the test case)
svn path=/trunk/; revision=4857
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/plparse/totem-pl-parser-podcast.c | 36 |
2 files changed, 27 insertions, 17 deletions
@@ -1,5 +1,13 @@ 2007-11-06 Bastien Nocera <hadess@hadess.net> + * src/plparse/totem-pl-parser-podcast.c: (parse_rss_items), + (totem_pl_parser_add_rss): Look for the feed metadata first, + as it might be at the end of the file (fixes parsing of + http://www.pinksilver.net/podcast/feed.xml, thanks Jonathan for + the test case) + +2007-11-06 Bastien Nocera <hadess@hadess.net> + * src/plparse/xmllexer.c: (lexer_decode_entities): Update decoding of decimal entities to match upstream patch by Darren Salt, thanks Darren! diff --git a/src/plparse/totem-pl-parser-podcast.c b/src/plparse/totem-pl-parser-podcast.c index 42b4238e4..0ab447aa8 100644 --- a/src/plparse/totem-pl-parser-podcast.c +++ b/src/plparse/totem-pl-parser-podcast.c @@ -202,6 +202,7 @@ parse_rss_items (TotemPlParser *parser, const char *url, xml_node_t *parent) title = language = description = author = NULL; contact = img = pub_date = copyright = NULL; + /* We need to parse for the feed metadata first, then for the items */ for (node = parent->child; node != NULL; node = node->next) { if (node->name == NULL) continue; @@ -233,26 +234,27 @@ parse_rss_items (TotemPlParser *parser, const char *url, xml_node_t *parent) } else if (g_ascii_strcasecmp (node->name, "copyright") == 0) { copyright = node->data; } + } - if (g_ascii_strcasecmp (node->name, "item") == 0) { - if (started == FALSE) { - /* Send the info we already have about the feed */ - totem_pl_parser_add_url (parser, - TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE, - TOTEM_PL_PARSER_FIELD_URL, url, - TOTEM_PL_PARSER_FIELD_TITLE, title, - TOTEM_PL_PARSER_FIELD_LANGUAGE, language, - TOTEM_PL_PARSER_FIELD_DESCRIPTION, description, - TOTEM_PL_PARSER_FIELD_AUTHOR, author, - TOTEM_PL_PARSER_FIELD_PUB_DATE, pub_date, - TOTEM_PL_PARSER_FIELD_COPYRIGHT, copyright, - TOTEM_PL_PARSER_FIELD_IMAGE_URL, img, - NULL); - started = TRUE; - } + /* Send the info we already have about the feed */ + totem_pl_parser_add_url (parser, + TOTEM_PL_PARSER_FIELD_IS_PLAYLIST, TRUE, + TOTEM_PL_PARSER_FIELD_URL, url, + TOTEM_PL_PARSER_FIELD_TITLE, title, + TOTEM_PL_PARSER_FIELD_LANGUAGE, language, + TOTEM_PL_PARSER_FIELD_DESCRIPTION, description, + TOTEM_PL_PARSER_FIELD_AUTHOR, author, + TOTEM_PL_PARSER_FIELD_PUB_DATE, pub_date, + TOTEM_PL_PARSER_FIELD_COPYRIGHT, copyright, + TOTEM_PL_PARSER_FIELD_IMAGE_URL, img, + NULL); + for (node = parent->child; node != NULL; node = node->next) { + if (node->name == NULL) + continue; + + if (g_ascii_strcasecmp (node->name, "item") == 0) parse_rss_item (parser, node); - } } totem_pl_parser_playlist_end (parser, url); |