SUMMARY When I add a new subdirectory to the folder Reggae in my local collection, all songs in the folder Reggeaton disappear from the local collection. Using the Tools > Update Collection menu item, the track re-appear, but all statistics (first played, last played, play count) and lyrics are lost. STEPS TO REPRODUCE 1. Create folders Reggae and Reggaeton in the same parent directory and add both to the local collection. 2. Add sub-directories and songs to both of those folder. 3. Play each song at least once. 4. Add lyrics to some of the songs. 5. With amarok running, add a new subdirectory with a few songs to the Reggae folder. OBSERVED RESULT All songs from the Reggaeton folder disappear from the collection. They may re-appear when the collection is re-scanned, but then statistics and lyrics are lost. EXPECTED RESULT All old and new songs should appear in the local collection. SOFTWARE/OS VERSIONS Linux/KDE Plasma: OpenSUSE 15.5 5.14.21-150500.55.19-default #1 SMP PREEMPT_DYNAMIC Tue Aug 8 22:15:01 UTC 2023 (9908c29) x86_64 x86_64 x86_64 GNU/Linux KDE Plasma Version: 5.102.0 KDE Frameworks Version: 5.103.0 ADDITIONAL INFORMATION The same happened previously with the folders Latin and Latin_Hip-Hop. Could it have an effect that one folder name is a substring of the other folder name?
Thank you for the report! Seems to be reproducable, I will inspect & try to fix this before 3.0.
Managed to narrow down reproduction a bit: Start with an empty embedded database, have tracks Foghat/Foghat - 01 - Honey Hush.ogg Fogh/16 - Punk Reggae Party.ogg in library path. Scan the library and observe both of them appear in collection browser. Add both tracks to playlist. The other one does not have to be played. Start playing Foghat/Energized/Foghat - 01 - Honey Hush.ogg, skip to nearly end of the track but make sure it plays some seconds., check that playcount after playing is 1 touch Fogh/ Foghat - Honey Hush disappears from collection. If not with first try, playing the track some seconds and doing touch Fogh/ again will probably do trick.
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/amarok/-/merge_requests/88
Git commit 154e31b5b3002f0bb290ef55ec0eb6c612113e91 by Tuomas Nurmi. Committed on 20/04/2024 at 11:04. Pushed by nurmi into branch 'master'. Fix erronous database query After three days of debugging, refreshing related autotests, writing more tests, hunting for differences between autotest mock components and real ones and digging deep into database queries related to saving paths, I am happy to announce that I have a fix which changes a single _ to /. I guess the original idea might have been to handle both unix and windows path separators. However, based on my digging, I think Qt does that anyhow in every case before anything is written to db. Also, the directories saved into db always come from MountPointManager's getRelativePath, which has never a trailing /, so the slash instead of underscore should always be a correct character here to match subdirectories. M +1 -1 src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp https://invent.kde.org/multimedia/amarok/-/commit/154e31b5b3002f0bb290ef55ec0eb6c612113e91
(In reply to Tuomas Nurmi from comment #4) > After three days of debugging, refreshing related autotests, writing more > tests, > hunting for differences between autotest mock components and real ones and > digging > deep into database queries related to saving paths, I am happy to announce > that I > have a fix which changes a single _ to /. Thank you!
(In reply to Tuomas Nurmi from comment #4) > Git commit 154e31b5b3002f0bb290ef55ec0eb6c612113e91 by Tuomas Nurmi. > Committed on 20/04/2024 at 11:04. > Pushed by nurmi into branch 'master'. > > Fix erronous database query > > After three days of debugging, refreshing related autotests, writing more > tests, > hunting for differences between autotest mock components and real ones and > digging > deep into database queries related to saving paths, I am happy to announce > that I > have a fix which changes a single _ to /. > > I guess the original idea might have been to handle both unix and windows > path > separators. However, based on my digging, I think Qt does that anyhow in > every case > before anything is written to db. Also, the directories saved into db always > come > from MountPointManager's getRelativePath, which has never a trailing /, so > the > slash instead of underscore should always be a correct character here to > match > subdirectories. > > M +1 -1 src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp > > https://invent.kde.org/multimedia/amarok/-/commit/ > 154e31b5b3002f0bb290ef55ec0eb6c612113e91 Your welcome! I think I've hit this bug myself once or twice, too, but it was too random to get a good grasp on where to inspect. Your observation on the substrings in folder names was very valuable in finding the cause of this, so thank you for that!