[totem-pl-parser] Don't use ":" as a separator in M3U playlists
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser] Don't use ":" as a separator in M3U playlists
- Date: Mon, 23 Aug 2010 09:47:17 +0000 (UTC)
commit a0824aa8e003b62b8976d2cb683c0cae09d2d6a2
Author: Bastien Nocera <hadess hadess net>
Date: Mon Aug 23 10:45:53 2010 +0100
Don't use ":" as a separator in M3U playlists
Fixes parsing of titles with ":" in their titles.
https://bugzilla.gnome.org/show_bug.cgi?id=609091
plparse/tests/Makefile.am | 3 ++-
plparse/tests/parser.c | 13 +++++++++++++
plparse/tests/separator.m3u | 3 +++
plparse/totem-pl-parser-lines.c | 7 -------
4 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/plparse/tests/Makefile.am b/plparse/tests/Makefile.am
index c553016..1c8b5b4 100644
--- a/plparse/tests/Makefile.am
+++ b/plparse/tests/Makefile.am
@@ -58,4 +58,5 @@ EXTRA_DIST = \
missing-items.pls \
playlist.xspf \
new-lastfm-output.xspf \
- old-lastfm-output.xspf
+ old-lastfm-output.xspf \
+ separator.m3u
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index d952915..097ce10 100644
--- a/plparse/tests/parser.c
+++ b/plparse/tests/parser.c
@@ -431,6 +431,18 @@ test_lastfm_parsing (void)
}
static void
+test_m3u_separator (void)
+{
+ char *uri;
+
+ g_test_bug ("609091");
+
+ uri = get_relative_uri (TEST_SRCDIR "separator.m3u");
+ g_assert_cmpstr (parser_test_get_entry_field (uri, TOTEM_PL_PARSER_FIELD_TITLE), ==, "Music Tech Sessions (Friday 22 January 2010 20:00 - 00:00)");
+ g_free (uri);
+}
+
+static void
test_parsing_xspf_genre (void)
{
char *uri;
@@ -765,6 +777,7 @@ main (int argc, char *argv[])
g_test_add_func ("/parser/parsing/xspf_genre", test_parsing_xspf_genre);
g_test_add_func ("/parser/parsing/itms_link", test_itms_parsing);
g_test_add_func ("/parser/parsing/lastfm-attributes", test_lastfm_parsing);
+ g_test_add_func ("/parser/parsing/m3u_separator", test_m3u_separator);
return g_test_run ();
}
diff --git a/plparse/tests/separator.m3u b/plparse/tests/separator.m3u
new file mode 100644
index 0000000..35380e2
--- /dev/null
+++ b/plparse/tests/separator.m3u
@@ -0,0 +1,3 @@
+#EXTM3U
+#EXTINF:-1,Music Tech Sessions (Friday 22 January 2010 20:00 - 00:00)
+http://www.icradio.com/media-icrfs2/226313.mp3
diff --git a/plparse/totem-pl-parser-lines.c b/plparse/totem-pl-parser-lines.c
index 0ff94ff..b2bb7e9 100644
--- a/plparse/totem-pl-parser-lines.c
+++ b/plparse/totem-pl-parser-lines.c
@@ -322,13 +322,6 @@ totem_pl_parser_get_extinfo_title (const char *extinfo)
if (res[0] == '\0')
return NULL;
- /* Handle ':' as a field separator */
- sep = strstr (res, ":");
- if (sep != NULL && sep[1] != '\0') {
- sep++;
- return sep;
- }
-
/* Handle ',' as a field separator */
sep = strstr (res, ",");
if (sep == NULL || sep[1] == '\0') {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]