[rhythmbox] Add support for itmss:// links to podcasts



commit dcb5ed4b6656bb087e94bccd23e64d746c04cb09
Author: Matt Novenstern <fisxoj gmail com>
Date:   Fri Aug 30 13:59:29 2013 -0400

    Add support for itmss:// links to podcasts
    
    A simple matter of allowing the links to be passed through to
    totem-pl-parser, where they have already done all the clever
    work.

 configure.ac                    |    2 +-
 lib/rb-file-helpers.c           |    9 ++++++++-
 podcast/rb-podcast-add-dialog.c |    1 +
 3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 74c00ac..a95d35f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -659,7 +659,7 @@ AC_ARG_VAR([MOZILLA_PLUGINDIR],[Where to install the browser plugin to])
 
 AM_CONDITIONAL([ENABLE_BROWSER_PLUGIN], test x$enable_browser_plugin = xyes)
 if test x$enable_browser_plugin = xyes; then
-       ITMS_HANDLER="x-scheme-handler/itms;"
+       ITMS_HANDLER="x-scheme-handler/itms;x-scheme-handler/itmss;"
 fi
 AC_SUBST(ITMS_HANDLER)
 
diff --git a/lib/rb-file-helpers.c b/lib/rb-file-helpers.c
index b1c906d..3f1d0bc 100644
--- a/lib/rb-file-helpers.c
+++ b/lib/rb-file-helpers.c
@@ -585,7 +585,8 @@ rb_uri_could_be_podcast (const char *uri, gboolean *is_opml)
        /* Check the scheme is a possible one first */
        if (g_str_has_prefix (uri, "http") == FALSE &&
            g_str_has_prefix (uri, "itpc:") == FALSE &&
-           g_str_has_prefix (uri, "itms:") == FALSE) {
+           g_str_has_prefix (uri, "itms:") == FALSE &&
+           g_str_has_prefix (uri, "itmss:") == FALSE) {
                rb_debug ("'%s' can't be a Podcast or OPML file, not the right scheme", uri);
                return FALSE;
        }
@@ -597,6 +598,12 @@ rb_uri_could_be_podcast (const char *uri, gboolean *is_opml)
            && strstr (uri, "viewPodcast") != NULL)
                return TRUE;
 
+       /* Check for new itmss stype iTunes Music Store link
+        * to a podcast */
+       if (g_str_has_prefix (uri, "itmss:") != FALSE
+           && strstr (uri, "podcast") != NULL)
+               return TRUE;
+
        query_string = strchr (uri, '?');
        if (query_string == NULL) {
                query_string = uri + strlen (uri);
diff --git a/podcast/rb-podcast-add-dialog.c b/podcast/rb-podcast-add-dialog.c
index 5d2c96f..9315a99 100644
--- a/podcast/rb-podcast-add-dialog.c
+++ b/podcast/rb-podcast-add-dialog.c
@@ -103,6 +103,7 @@ static const char *podcast_uri_prefixes[] = {
        "zune://",
        "itpc://",
        "itms://",
+       "itmss://",
        "www.",
 };
 


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