Commit d1d6ad9c authored by Sam Thursfield's avatar Sam Thursfield

Correctly parse XSPF title field

Previously all XSPF playlists had the name "title".
parent b58c60f8
Pipeline #223488 failed with stage
in 5 minutes and 1 second
......@@ -644,6 +644,15 @@ test_parsing_xspf_escaping (void)
g_free (uri);
}
static void
test_parsing_xspf_metadata (void)
{
char *uri;
uri = get_relative_uri (TEST_SRCDIR "playlist.xspf");
g_assert_cmpstr (parser_test_get_playlist_field (uri, TOTEM_PL_PARSER_FIELD_TITLE), ==, "Test Playlist");
g_free (uri);
}
static void
test_parsing_xspf_xml_base (void)
{
......@@ -1446,6 +1455,7 @@ main (int argc, char *argv[])
g_test_add_func ("/parser/parsing/num_items_in_pls", test_parsing_num_entries);
g_test_add_func ("/parser/parsing/xspf_genre", test_parsing_xspf_genre);
g_test_add_func ("/parser/parsing/xspf_escaping", test_parsing_xspf_escaping);
g_test_add_func ("/parser/parsing/xspf_metadata", test_parsing_xspf_metadata);
g_test_add_func ("/parser/parsing/xspf_xml_base", test_parsing_xspf_xml_base);
g_test_add_func ("/parser/parsing/test_pl_content_type", test_pl_content_type);
g_test_add_func ("/parser/parsing/itms_link", test_itms_parsing);
......
<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<creator>audacious-plugins-1.4.5</creator>
<title>Test Playlist</title>
<trackList>
<track>
<location>http://207.200.96.226:8000 extraparam=1</location>
......
......@@ -473,7 +473,7 @@ parse_xspf_entries (TotemPlParser *parser,
continue;
if (g_ascii_strcasecmp ((char *)node->name, "title") == 0) {
title = node->name;
title = xmlNodeListGetString (doc, node->xmlChildrenNode, 1);
break;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment