Bug 128918

Summary: itpc url handle podcast
Product: [Applications] amarok Reporter: José JORGE <lists.jjorge>
Component: PodcastAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description José JORGE 2006-06-09 23:03:23 UTC
Version:           1.4-SVN-20060601 (using KDE 3.5.3, Mandriva Linux Cooker i586 - Cooker)
Compiler:          Target: i586-mandriva-linux-gnu
OS:                Linux (i686) release 2.6.16-1mdk

As urls like itpc://radiofrance-podcast.net/podcast/rss_16279.xml exist, and amarok is able to use them, it should inform KDE that he knows it, so from konqueror we can click on it, and being asked if we want to add it to amarok podcasts.
Comment 1 José JORGE 2006-06-09 23:05:39 UTC
This is wished as manualy copying the url to amarok, and replacing itpc: with http: is not an end user solution ;-)
Comment 2 Ian Monroe 2006-06-10 14:19:19 UTC
You mean iptc?
Comment 3 José JORGE 2006-06-11 21:39:15 UTC
no it is itpc:// lokk in this page for example

http://www.radiofrance.fr/services/rfmobiles/podcast/index.php?chaine=1
Comment 4 Martin Aumueller 2006-08-16 19:47:48 UTC
SVN commit 573571 by aumuell:

let amarok handle itpc:// and pcast:// style links for adding podcasts
BUG: 128918


 M  +2 -0      ChangeLog  
 M  +3 -1      src/Makefile.am  
 A             src/amarokitpc.protocol   src/amaroklastfm.protocol#573559
 A             src/amarokpcast.protocol   src/amaroklastfm.protocol#573559
 M  +8 -1      src/app.cpp  
 M  +5 -1      src/playlistbrowser.cpp  


--- trunk/extragear/multimedia/amarok/ChangeLog #573570:573571
@@ -5,6 +5,8 @@
 
 VERSION 1.4.2:
   FEATURES:
+    * Handle itpc:// and pcast:// url protocols for adding podcast feeds.
+      (BR 128918)
     * New DCOP call "collection: totalComposers" returns the number of
       different composers in your collection.
     * Synchronize playlists to media devices.
--- trunk/extragear/multimedia/amarok/src/Makefile.am #573570:573571
@@ -231,7 +231,9 @@
     $(kde_servicesdir)
 
 protocol_DATA = \
-    amaroklastfm.protocol
+    amarokitpc.protocol \
+    amaroklastfm.protocol \
+    amarokpcast.protocol
 
 messages: rc.cpp
 	$(EXTRACTRC) `find . -name "*.rc" -o -name "*.ui" -o -name "*.kcfg"` > rc.cpp
--- trunk/extragear/multimedia/amarok/src/app.cpp #573570:573571
@@ -36,6 +36,7 @@
 #include "osd.h"
 #include "playerwindow.h"
 #include "playlist.h"
+#include "playlistbrowser.h"
 #include "playlistwindow.h"
 #include "pluginmanager.h"
 #include "refreshimages.h"
@@ -211,7 +212,13 @@
     {
         KURL::List list;
         for( int i = 0; i < args->count(); i++ )
-            list << args->url( i );
+        {
+            KURL url = args->url( i );
+            if( url.protocol() == "itpc" || url.protocol() == "pcast" )
+                PlaylistBrowser::instance()->addPodcast( url );
+            else
+                list << url;
+        }
 
         int options;
         bool appendAsDefault = amaroK::config()->readBoolEntry( "AppendAsDefault", false );
--- trunk/extragear/multimedia/amarok/src/playlistbrowser.cpp #573570:573571
@@ -1302,10 +1302,14 @@
     return 0;
 }
 
-void PlaylistBrowser::addPodcast( const KURL& url, QListViewItem *parent )
+void PlaylistBrowser::addPodcast( const KURL& origUrl, QListViewItem *parent )
 {
     if( !parent ) parent = static_cast<QListViewItem*>(m_podcastCategory);
 
+    KURL url( origUrl );
+    if( url.protocol() == "itpc" || url.protocol() == "pcast" )
+        url.setProtocol( "http" );
+
     PodcastChannel *channel = findPodcastChannel( url );
     if( channel )
     {