Bug 135681 - regression: podcasts cannot be transfered directly to generic media-players
Summary: regression: podcasts cannot be transfered directly to generic media-players
Status: RESOLVED INTENTIONAL
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Media Devices (show other bugs)
Version: 1.4.3
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-15 11:23 UTC by S. Burmeister
Modified: 2008-08-06 00:03 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description S. Burmeister 2006-10-15 11:23:38 UTC
Version:           1.4.3 (using KDE KDE 3.5.5)
OS:                Linux

In 1.4.1 maybe even 1.4.2 I could drag a podcast directly into the media-player transfer-queue (still possible). I could then transfer it to the media-player, i.e. amarok downloaded it directly to the media-player.

With 1.4.3 when I want to transfer the podcast, it fails. I have to download it first, i.e. save it on the hdd and then drag it do the transfer-queue.
Comment 1 Martin Aumueller 2006-10-22 14:33:43 UTC
SVN commit 598066 by aumuell:

fix direct copying of podcasts to ipods
BUG: 135681


 M  +2 -0      ChangeLog  
 M  +31 -31    src/mediadevice/ipod/ipodmediadevice.cpp  
 M  +7 -6      src/mediadevice/ipod/ipodmediadevice.h  


--- trunk/extragear/multimedia/amarok/ChangeLog #598065:598066
@@ -63,6 +63,8 @@
     * Show a proper tag dialog when viewing information for DAAP music shares.
 
   BUGFIXES:
+    * Direct copying of non-local items would result in wrong properties on
+      iPods. (BR 135681)
     * Honor setting to show Amarok's menu in main toolbar.
     * "Burn this album" would burn all albums of the same name. (BR 121963)
     * Ignore double-clicks on tree item openers. (BR 125121)
--- trunk/extragear/multimedia/amarok/src/mediadevice/ipod/ipodmediadevice.cpp #598065:598066
@@ -262,14 +262,17 @@
 }
 
 MediaItem *
-IpodMediaDevice::insertTrackIntoDB( const QString &pathname, const MetaBundle &bundle, const PodcastInfo *podcastInfo )
+IpodMediaDevice::insertTrackIntoDB( const QString &pathname,
+        const MetaBundle &metaBundle, const MetaBundle &propertiesBundle,
+        const PodcastInfo *podcastInfo )
 {
-    return updateTrackInDB( 0, pathname, bundle, podcastInfo );
+    return updateTrackInDB( 0, pathname, metaBundle, propertiesBundle, podcastInfo );
 }
 
 MediaItem *
 IpodMediaDevice::updateTrackInDB( IpodMediaItem *item, const QString &pathname,
-                                  const MetaBundle &bundle, const PodcastInfo *podcastInfo )
+                                  const MetaBundle &metaBundle, const MetaBundle &propertiesBundle,
+                                  const PodcastInfo *podcastInfo )
 {
     if( !m_itdb )
         return 0;
@@ -290,10 +293,10 @@
     track->ipod_path = g_strdup( ipodPath(pathname).latin1() );
     debug() << "on iPod: " << track->ipod_path << ", podcast=" << podcastInfo << endl;
 
-    track->title = g_strdup( bundle.title().utf8() );
-    track->album = g_strdup( bundle.album()->utf8() );
-    track->artist = g_strdup( bundle.artist()->utf8() );
-    track->genre = g_strdup( bundle.genre()->utf8() );
+    track->title = g_strdup( metaBundle.title().utf8() );
+    track->album = g_strdup( metaBundle.album()->utf8() );
+    track->artist = g_strdup( metaBundle.artist()->utf8() );
+    track->genre = g_strdup( metaBundle.genre()->utf8() );
     track->unk208 = 0x01; // for audio
     if(type=="wav")
     {
@@ -335,7 +338,7 @@
 #endif
         track->unk208 = 0x08; // for audiobooks
 
-        TagLib::Audible::File f( QFile::encodeName( bundle.url().path() ) );
+        TagLib::Audible::File f( QFile::encodeName( propertiesBundle.url().path() ) );
         TagLib::Audible::Tag *t = f.getAudibleTag();
         if( t )
             track->drm_userid = t->userID();
@@ -348,20 +351,20 @@
         track->filetype = g_strdup( type.utf8() );
     }
 
-    track->composer = g_strdup( bundle.composer()->utf8() );
-    track->comment = g_strdup( bundle.comment()->utf8() );
-    track->track_nr = bundle.track();
-    track->cd_nr = bundle.discNumber();
-    track->BPM = static_cast<int>( bundle.bpm() );
-    track->year = bundle.year();
-    track->size = bundle.filesize();
+    track->composer = g_strdup( metaBundle.composer()->utf8() );
+    track->comment = g_strdup( metaBundle.comment()->utf8() );
+    track->track_nr = metaBundle.track();
+    track->cd_nr = metaBundle.discNumber();
+    track->BPM = static_cast<int>( metaBundle.bpm() );
+    track->year = metaBundle.year();
+    track->size = propertiesBundle.filesize();
     if( track->size == 0 )
     {
         debug() << "filesize is zero for " << track->ipod_path << ", expect strange problems with your ipod" << endl;
     }
-    track->bitrate = bundle.bitrate();
-    track->samplerate = bundle.sampleRate();
-    track->tracklen = bundle.length()*1000;
+    track->bitrate = propertiesBundle.bitrate();
+    track->samplerate = propertiesBundle.sampleRate();
+    track->tracklen = propertiesBundle.length()*1000;
 
     if(podcastInfo)
     {
@@ -392,7 +395,7 @@
     {
         // FIXME: track->unk176 = 0x00010000; // for non-podcasts
 
-        if( bundle.compilation() == MetaBundle::CompilationYes )
+        if( metaBundle.compilation() == MetaBundle::CompilationYes )
         {
             track->compilation = 0x01;
         }
@@ -408,17 +411,17 @@
     if( m_supportsArtwork )
     {
         QString image;
-        if( bundle.podcastBundle() )
+        if( metaBundle.podcastBundle() )
         {
             PodcastChannelBundle pcb;
-            if( CollectionDB::instance()->getPodcastChannelBundle( bundle.podcastBundle()->parent(), &pcb ) )
+            if( CollectionDB::instance()->getPodcastChannelBundle( metaBundle.podcastBundle()->parent(), &pcb ) )
                 image = CollectionDB::instance()->podcastImage( pcb.imageURL().url(), 0 );
         }
         if( image.isEmpty() )
-            image  = CollectionDB::instance()->albumImage(bundle.artist(), bundle.album(), false, 0);
+            image  = CollectionDB::instance()->albumImage(metaBundle.artist(), metaBundle.album(), false, 0);
         if( !image.endsWith( "@nocover.png" ) )
         {
-            debug() << "adding image " << image << " to " << bundle.artist() << ":" << bundle.album() << endl;
+            debug() << "adding image " << image << " to " << metaBundle.artist() << ":" << metaBundle.album() << endl;
             itdb_track_set_thumbnails( track, g_strdup( QFile::encodeName(image) ) );
         }
     }
@@ -525,11 +528,8 @@
         podcastInfo->listened = !peb->isNew();
     }
 
-    MetaBundle *newBundle = 0;
-    if( bundle.url().isLocalFile() && !bundle.isValidMedia() )
-        newBundle = new MetaBundle( url );
-
-    MediaItem *ret = insertTrackIntoDB( url.path(), newBundle ? *newBundle : bundle, podcastInfo );
+    MetaBundle propertiesBundle( url );
+    MediaItem *ret = insertTrackIntoDB( url.path(), bundle, propertiesBundle, podcastInfo );
     delete podcastInfo;
     return ret;
 }
@@ -537,7 +537,7 @@
 MediaItem *
 IpodMediaDevice::tagsChanged( MediaItem *item, const MetaBundle &bundle )
 {
-    return updateTrackInDB( dynamic_cast<IpodMediaItem *>(item), item->url().path(), bundle, NULL );
+    return updateTrackInDB( dynamic_cast<IpodMediaItem *>(item), item->url().path(), bundle, bundle, NULL );
 }
 
 void
@@ -2118,7 +2118,7 @@
                             }
 
                             item->takeItem(it);
-                            insertTrackIntoDB(it->url().path(), *it->bundle(), 0);
+                            insertTrackIntoDB(it->url().path(), *it->bundle(), *it->bundle(), 0);
                             delete it;
                         }
                     }
@@ -2141,7 +2141,7 @@
                             }
 
                             i->parent()->takeItem(i);
-                            insertTrackIntoDB(i->url().path(), *i->bundle(), 0);
+                            insertTrackIntoDB(i->url().path(), *i->bundle(), *i->bundle(), 0);
                             delete i;
                         }
                     }
--- trunk/extragear/multimedia/amarok/src/mediadevice/ipod/ipodmediadevice.h #598065:598066
@@ -56,7 +56,7 @@
         void              unlockDevice() { m_mutex.unlock(); }
         void              initView();
 
-        virtual MediaItem*copyTrackToDevice( const MetaBundle& bundle );
+        virtual MediaItem *copyTrackToDevice( const MetaBundle& bundle );
         /**
          * Insert track already located on media device into the device's database
          * @param pathname Location of file on the device to add to the database
@@ -64,13 +64,14 @@
          * @param podcastInfo PodcastInfo of track if it is a podcast, 0 otherwise
          * @return If successful, the created MediaItem in the media device view, else 0
          */
-        virtual MediaItem *insertTrackIntoDB( const QString& pathname, const MetaBundle& bundle,
-                                              const PodcastInfo *podcastInfo );
+        virtual MediaItem *insertTrackIntoDB( const QString &pathname,
+                const MetaBundle &metaBundle, const MetaBundle &propertiesBundle,
+                const PodcastInfo *podcastInfo );
 
-        virtual MediaItem * updateTrackInDB( IpodMediaItem *item, const QString &pathname,
-                                             const MetaBundle &bundle, const PodcastInfo *podcastInfo );
+        virtual MediaItem *updateTrackInDB( IpodMediaItem *item, const QString &pathname,
+                const MetaBundle &metaBundle, const MetaBundle &propertiesBundle,
+                const PodcastInfo *podcastInfo );
 
-
         /**
          * Determine the url for which a track should be uploaded to on the device
          * @param bundle MetaBundle of track to base pathname creation on
Comment 2 S. Burmeister 2007-01-06 10:22:46 UTC
This is broken in 1.4.4. Further the "Transfer to media-player" is greyed out. Transfering directly should not need saving the file to the podcast directory first but transfer it directly to the media-player, as if one would download a file from the internet and save it on an usb-stick.
Comment 3 S. Burmeister 2007-01-06 10:27:37 UTC
Why was this only fixed for ipods and not media-players in general? At least it does not work on my generic media-player.
Comment 4 Martin Aumueller 2007-01-28 02:01:06 UTC
according to report, the problem still exists with generic media devices
Comment 5 Felix Zesch 2007-02-05 08:01:53 UTC
yes, it would be great to do it with one click. Until now, I have to wait until it is downloaded (and remember which podcast I wanted to transfer) and then queue it manually for transfer to the mp3 player. One-click solution would be much more comfortable.

Thank you!
Comment 6 Lydia Pintscher 2008-08-06 00:03:21 UTC
I am sorry but this will not get fixed in Amarok 1.4 as we are focused on Amarok 2 now.

Thank you for your report.