[totem-pl-parser] plparser: Add support for the itmss scheme



commit 5ad5be6b6848e6de8699013b8a9bfa8aa4bbdfd7
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Nov 7 21:51:50 2012 +0100

    plparser: Add support for the itmss scheme
    
    As used in
    https://itunes.apple.com/us/podcast/best-of-chris-moyles/id77318908
    for example.

 plparse/tests/parser.c            |    2 ++
 plparse/totem-pl-parser-podcast.c |    4 +++-
 2 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/plparse/tests/parser.c b/plparse/tests/parser.c
index 5a32b85..181c1d7 100644
--- a/plparse/tests/parser.c
+++ b/plparse/tests/parser.c
@@ -465,6 +465,8 @@ test_itms_parsing (void)
 		return;
 	}
 
+	/* From https://itunes.apple.com/us/podcast/best-of-chris-moyles/id77318908 */
+	g_assert_cmpstr (parser_test_get_playlist_uri ("itmss://itunes.apple.com/us/podcast/best-of-chris-moyles/id77318908?ign-msr=https%3A%2F%2Fwww.google.com%2Furl%3Fsa%3Dt%26rct%3Dj%26q%3D%26esrc%3Ds%26source%3Dweb%26cd%3D3%26ved%3D0CEEQFjAC%26url%3Dhttps%253A%252F%252Fitunes.apple.com%252Fus%252Fpodcast%252Fbest-of-chris-moyles%252Fid77318908%26ei%3DiMeaUO_ZIsfCtAbvk4DADA%26usg%3DAFQjCNE5YyukECjJE3fmrLIJICX5dMSyyg%26sig2%3DGM631xTbZq7E6m-eaGc3HA"), ==, "http://downloads.bbc.co.uk/podcasts/radio1/moyles/rss.xml";);
 	g_assert_cmpstr (parser_test_get_playlist_uri ("itms://itunes.apple.com/gb/podcast/best-of-chris-moyles-enhanced/id142102961?ign-mpt=uo%3D4"), ==, "http://downloads.bbc.co.uk/podcasts/radio1/moylesen/rss.xml";);
 	g_assert_cmpstr (parser_test_get_playlist_uri ("http://itunes.apple.com/gb/podcast/radio-1-mini-mix/id268491175?uo=4";), ==, "http://downloads.bbc.co.uk/podcasts/radio1/r1mix/rss.xml";);
 }
diff --git a/plparse/totem-pl-parser-podcast.c b/plparse/totem-pl-parser-podcast.c
index dd3ce82..ee3ead1 100644
--- a/plparse/totem-pl-parser-podcast.c
+++ b/plparse/totem-pl-parser-podcast.c
@@ -756,7 +756,8 @@ totem_pl_parser_add_itms (TotemPlParser *parser,
 	GFile *feed_file;
 	TotemPlParserResult ret;
 
-	if (g_file_has_uri_scheme (file, "itms") != FALSE) {
+	if (g_file_has_uri_scheme (file, "itms") != FALSE ||
+	    g_file_has_uri_scheme (file, "itmss") != FALSE) {
 		itms_uri= g_file_get_uri (file);
 		memcpy (itms_uri, "http", 4);
 	} else if (g_file_has_uri_scheme (file, "http") != FALSE) {
@@ -794,6 +795,7 @@ totem_pl_parser_is_itms_feed (GFile *file)
 	uri = g_file_get_uri (file);
 
 	if (g_file_has_uri_scheme (file, "itms") != FALSE ||
+	    g_file_has_uri_scheme (file, "itmss") != FALSE ||
 	    (g_file_has_uri_scheme (file, "http") != FALSE &&
 	     strstr (uri, ".apple.com/") != FALSE)) {
 		if (strstr (uri, "/podcast/") != NULL ||



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