Bug 176237

Summary: Import of amarok 1.4 collection fails to set "first played" date correctly
Product: [Applications] amarok Reporter: Sebastian Strand <sebstrand>
Component: generalAssignee: Amarok Bugs <amarok-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: hydrogen, ruiz
Priority: NOR    
Version First Reported In: 2.0-rc   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sebastian Strand 2008-11-27 16:32:17 UTC
Version:           1.98 / rc1 (using KDE 4.1.3)
Compiler:          gcc version 4.3.2 (GCC) x86_64
OS:                Linux
Installed from:    Compiled From Sources


When importing the old collection from amarok 1.4 (that used sqlite db), the "first played" date gets set to the date that the import is done instead of the correct date. The "last played" date is set correctly.

How to reproduce: import collection from amarok 1.4

Expected behaviour: "first played" gets set to the same value as in the old collection.
Comment 1 Mark Kretschmann 2008-11-27 16:50:51 UTC
Seb, any ideas on this?
Comment 2 Seb Ruiz 2008-11-27 22:30:45 UTC
Pretty sure it was working when I did so last, I'll have to do some more testing. It could be possible that you have multiple entries for the same urls which are causing the value to be overwritten (ie, different device ids merge to the same path)
Comment 3 Sebastian Strand 2008-11-28 21:00:24 UTC
I just realized that the tracks had already been added to the collection when I did the import. I redid the whole thing, but this time I did the import first, then I added the music folders to the collection. Now "first played" is set correctly. Not sure if it is supposed to work if you do it the other way?
Comment 4 Dan Meltzer 2008-12-02 18:41:29 UTC
Targetting this for 2.0 as I don't think it would be that complicated to pick the earlier date (and anyone that uses a2 with music in the default path might have a collection before they import it)

If the importer is run before the default collection is built this can probably be pushed back, or if this is more complicated than it sounds to fix.
Comment 5 Seb Ruiz 2008-12-17 11:52:02 UTC
SVN commit 897993 by seb:

Do some slight sanity checking when updating metdata of imported tracks.
eg:
 - don't set empty fields (rating, score, playcount)
 - don't set older lastPlayed or newer firstPlayed dates
This is useful since there may be multiple database entries which map to
single urls in the 1.4 database due to HDD changes and dynamic
collections. This tries to take the best of each statistic row as the
best heuristic.
BUG: 176237
CCBUG: 174784

 M  +20 -5     SqlMeta.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=897993