Version: 2.4.0.90 (using KDE 4.4.5) OS: Linux Amarok not handle correctly, when I swap names of files in collection. Reproducible: Always Steps to Reproduce: 1. Place to the collection two audio files, for example 01.mp3 and 02.mp3. 2. Rename 01.mp3 to 02.mp3 and 02.mp3 to 01.mp3 3. Update collection or do a collection rescan Actual Results: Error message: The collection scanner reported the following errors: GREPME MySQLe query failed! (1062) Duplicate entry 'amarok-sqltrackuid://ef4fbaf05bcffdb2b19263e8fafb2e50' for key 'uniqueid' on INSERT INTO urls (deviceid,rpath,directory,uniqueid) VALUES (-1,'./home/nekit/Music/01.mp3',1,'amarok-sqltrackuid://ef4fbaf05bcffdb2b19263e8fafb2e50'); In most cases this means that not all of your tracks were imported. Further errors will only be reported on the console. And only one file will be in the collection. Expected Results: Should correctly update collection. Collection rescan may help to fix collection. But may not.
Please upgrade to Amarok 2.4.1 final and try again, this is likely already fixed.
Checked with version 2.4.1. No error message now, but only one file left in the collection. Also, full rescan don't fixes the collection.
Thank you for the feedback.
Tried it in Amarok 2.5 running on KDE 4.7.4 and the problem exists. On swapping names in Dolphin and restarting Amarok, I see the same Error dialog box as mentioned in initial bug description.
Setting status to confirmed.
Reproducible in v2.6.90-71-g5d81710. I fear that the only real solution would be to enclose database update in a SQL transaction, which is not supported in MyISAM tables Amarok currently uses in its MySQL database. :-( Work-around is of course not to swap-rename files when Amarok is not running, instead do it in 2 steps and have Amarok's update collection fire in between. If you can afford to loose statistics/lyrics/labels, you can move the files out of collection and then back in.
Git commit 0aeb1fafb3469d772b601441b29cdc5cb20d3589 by Ralf Engels. Committed on 28/02/2013 at 16:45. Pushed by rengels into branch 'master'. Fix: amarok erroneously merges two albums We are now keeping the information that an album artist is set until the very end. So albums with an album artist and only a guessed album artist are not merged. Also add auto test for "Amarok collection scanner not handle correctly cross-renaming" Related: bug 216759 FIXED-IN: 2.8 M +6 -0 shared/collectionscanner/Album.cpp M +1 -0 shared/collectionscanner/Album.h M +60 -65 src/core-impl/collections/db/ScanResultProcessor.cpp M +1 -3 src/core-impl/collections/db/ScanResultProcessor.h M +1 -1 src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp M +113 -5 tests/core-impl/collections/db/sql/TestSqlScanManager.cpp M +15 -1 tests/core-impl/collections/db/sql/TestSqlScanManager.h http://commits.kde.org/amarok/0aeb1fafb3469d772b601441b29cdc5cb20d3589