------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. http://bugs.kde.org/show_bug.cgi?id=117380 aumuell reserv at changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Additional Comments From aumuell reserv at 2005-11-30 23:31 ------- SVN commit 484472 by aumuell: also compare track number when checking if track is already present on ipod BUG: 117380 M +2 -0 ChangeLog M +18 -9 src/gpodmediadevice/gpodmediadevice.cpp M +1 -1 src/gpodmediadevice/gpodmediadevice.h M +8 -4 src/mediabrowser.cpp M +1 -1 src/mediabrowser.h --- trunk/extragear/multimedia/amarok/ChangeLog #484471:484472 @ -59,6 +59,8 @ compatibility with various iPod models. BUGFIXES: + * Also take track number into account when comparing tags for checking + if a track is already present on iPod. (BR 117380) * "Show Fullsize" now works for ID3 embedded cover images. (BR 114517) (BACKPORT?) * Fix possible bug when saving unencoded podcasts to strange file systems. --- trunk/extragear/multimedia/amarok/src/gpodmediadevice/gpodmediadevice.cpp #484471:484472 @ -309,9 +309,10 @ MediaItem * GpodMediaDevice::trackExists( const MetaBundle& bundle ) { - GpodMediaItem *item = getTitle( bundle.artist(), + GpodMediaItem *item = getTrack( bundle.artist(), bundle.album().isEmpty() ? i18n( "Unknown" ) : bundle.album(), - bundle.title()); + bundle.title(), + bundle.track() ); return item; } @ -1074,14 +1075,18 @ } GpodMediaItem * -GpodMediaDevice::getTitle(const QString &artist, const QString &album, const QString &title) +GpodMediaDevice::getTrack(const QString &artist, const QString &album, const QString &title, int trackNumber) { GpodMediaItem *item = getAlbum(artist, album); if(item) { - GpodMediaItem *track = dynamic_cast(item->findItem(title)); - if(track) - return track; + for( GpodMediaItem *track = dynamic_cast(item->findItem(title)); + track; + track = dynamic_cast(item->findItem(title, track)) ) + { + if( trackNumber==-1 || track->bundle()->track() == trackNumber ) + return track; + } } if(m_podcastItem) @ -1089,9 +1094,13 @ item = dynamic_cast(m_podcastItem->findItem(album)); if(item) { - GpodMediaItem *track = dynamic_cast(item->findItem(title)); - if(track) - return track; + for( GpodMediaItem *track = dynamic_cast(item->findItem(title)); + track; + track = dynamic_cast(item->findItem(title, track)) ) + { + if( trackNumber==-1 || track->bundle()->track() == trackNumber ) + return track; + } } } --- trunk/extragear/multimedia/amarok/src/gpodmediadevice/gpodmediadevice.h #484471:484472 @ -89,7 +89,7 @ GpodMediaItem *getArtist(const QString &artist); GpodMediaItem *getAlbum(const QString &artist, const QString &album); - GpodMediaItem *getTitle(const QString &artist, const QString &album, const QString &title); + GpodMediaItem *getTrack(const QString &artist, const QString &album, const QString &title, int trackNumber=-1); bool removeDBTrack(Itdb_Track *track); --- trunk/extragear/multimedia/amarok/src/mediabrowser.cpp #484471:484472 @ -462,11 +462,15 @ } MediaItem * -MediaItem::findItem( const QString &key ) const +MediaItem::findItem( const QString &key, const MediaItem *after ) const { - for(MediaItem *it = dynamic_cast(firstChild()); - it; - it = dynamic_cast(it->nextSibling())) + MediaItem *it = 0; + if( after ) + it = dynamic_cast( after->nextSibling() ); + else + it = dynamic_cast( firstChild() ); + + for( ; it; it = dynamic_cast(it->nextSibling())) { if(key == it->text(0)) return it; --- trunk/extragear/multimedia/amarok/src/mediabrowser.h #484471:484472 @ -48,7 +48,7 @ void setType( Type type ); Type type() const { return m_type; } - MediaItem *findItem(const QString &key) const; + MediaItem *findItem(const QString &key, const MediaItem *after=0) const; virtual bool isLeafItem() const; // A leaf node of the tree virtual bool isFileBacked() const; // Should the file be deleted of the device when removed