Bug 262459 - Information on several tracks lost after deleting some music
Summary: Information on several tracks lost after deleting some music
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.4-GIT
Platform: Unlisted Binaries Linux
: VHI normal
Target Milestone: 2.4.0
Assignee: Amarok Developers
URL:
Keywords: release_blocker
Depends on:
Blocks:
 
Reported: 2011-01-07 22:29 UTC by Frederik Schwarzer
Modified: 2011-01-09 03:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.4


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederik Schwarzer 2011-01-07 22:29:03 UTC
Version:           2.4-GIT
OS:                Linux

I just deleted one folder from my collection using Dolphin.
Then I selected "Tools -> Update Collection" from the menu.
After the rescan information on some of the other (still existing) tracks disappeared from the playlist. When finally one of those almost empty tracks was played, even the context info is empty.

A complete rescan did not help.
Restarting Amarok helped bringing the information back to the surface.

Reproducible: Didn't try

Steps to Reproduce:
How I did it:
Dynamic playlist. Track from Bad A just playing ...
- remove Band A from hard disk
- Tools -> Update Collection


Actual Results:  
Several entries in the playlist got emptied (but are still playable)


OS: Linux (i686) release 2.6.36-fs
Compiler: gcc
Comment 1 Mark Kretschmann 2011-01-08 19:12:16 UTC
commit 137de448c030cbfeb9de3bc21969f259a7291eca
branch master
Author: Mark Kretschmann <kretschmann@kde.org>
Date:   Sat Jan 8 19:08:55 2011 +0100

    Fix major issue with the Collection missing whole albums, and mixing up artists.
    
    Big thanks to Ralf Engels, who came up with this fix! :)
    
    BUG: 262459
    CCMAIL: amarok-devel@kde.org

diff --git a/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp b/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp
index d861da8..4a2b1ab 100644
--- a/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp
+++ b/src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp
@@ -161,6 +161,7 @@ SqlScanResultProcessor::commitTrack( CollectionScanner::Track *track,
     if( m_foundTracks.contains( uid ) )
     {
         warning() << "track"<<track->path()<<"with uid"<<uid<<"already committed. There seems to be a duplicate uid.";
+        return;
     }
     m_foundTracks.insert( uid );
Comment 2 Ralf Engels 2011-01-08 19:15:26 UTC
I hope that solves the problem. If not can you give more information.

Which tracks got emptied? Is there some relation to the deleted tracks (same directory e.g.)

What happens if you "touch" the directory with the emptied tracks and do a rescan?

What happens with the collection (the tab on the left side). Is the collection updated? Do the tracks disappear from there too?
Comment 3 Frederik Schwarzer 2011-01-09 03:27:09 UTC
As far as I see it now, only the entries of the deleted folders are emptied in the playlist.

On further testing however, Amarok crashed without a backtrace. I will open another report for that.

Thanks for the quick fix. :)