Bug 178973 - Collection get messed up after adding new folders
Summary: Collection get messed up after adding new folders
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.1-SVN
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 176290 176874 184888 188166 192027 192950 193288 194198 194472 196094 197044 198209 199388 199739 202488 206251 207703 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-12-28 17:08 UTC by Knut Johansson
Modified: 2009-12-09 11:29 UTC (History)
34 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot messed up collection (96.47 KB, image/png)
2009-01-12 17:06 UTC, Thomas H
Details
collection mixed up (273.20 KB, image/png)
2009-01-31 13:58 UTC, Andi Clemens
Details
Amarok Collection Update Bug (334.55 KB, image/png)
2009-02-24 20:51 UTC, hyper_ch
Details
Collection messed up (257.73 KB, image/png)
2009-03-20 20:28 UTC, Mikko C.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Knut Johansson 2008-12-28 17:08:39 UTC
Version:           2.0 (using KDE 4.1.3)
OS:                Linux
Installed from:    SuSE RPMs

Adding or removing collection folders result in a messed up collection, where artist, albums, tracks and cover art are mixed seemingly random in the collection manager.

I'll do a short description of how my files are organized and then describe the steps taken to reproduce the bug.

I have a fairly small collection, built around two main directories, ogg and mp3. Both are arranged the same way, with sub folders for artist containing albums. The whole ogg folder is in the collection and the content of the mp3 folder get added individually based on artists.

Reproducing is easy, but not consistent. The collection seems to get messed up differently every time.
- I start with no collection and add according to the above description(Empty play list and not playing).
- After the collection is scanned, I check it to see if it looks ok.
- Then I select 2 albums to be shown under various artists(not sure if it's relevant or not)
- Then i move a folder with one artist and two albums to the mp3 folder, and add the artist accordingly in the configure collection dialog.
- When the scan is complete, lots of albums in the collection have lost it cover art and pressing the + shows no tracks on those albums. Albums having cover art also has tracks. The albums in Various artist are reverted, but still contain a menu item saying do not show in varius artis(selecting it chrash Amarok)
- Exit and restart Amarok. The collection now appear much better(did not verify every track). (That the collection change after restart I consider alarming, and indicate that something is very wrong) Except artist with more than 5 albums lose most albums. And the albums moved to various artist, they are still  reverted. And various artist contained one entry called Unknown containing no tracks.
- Subsequently removing or adding one directory from the collection messes it up further

To illustrate, under Accept I have 2 albums. But after above procedure I suddenly find that one of those are "For those Bout To Rock" by AC/DC(Correct cover art for the album btw) and more surprisingly the tracks are from Aerosmith's Permanent Vacation.
Comment 1 Mark Kretschmann 2008-12-28 17:16:49 UTC
I think this might be a subset of a scanner bug issue, for which we have
another bug report.

Closing as a dupe for now.


*** This bug has been marked as a duplicate of bug 176154 ***
Comment 2 Knut Johansson 2009-01-04 00:25:30 UTC
Reopen, as fix for bug 176154 did not fix the issues.
Comment 3 Mark Kretschmann 2009-01-04 10:25:49 UTC
Ok, after reading this again, I think this part here is relevant: "Then I select 2 albums to be shown under various artists".

So, what we are dealing with here is probably a variant of the existing "Various Artists" issues. We got a bug report for that, so I'm closing as dupe.



*** This bug has been marked as a duplicate of bug 172953 ***
Comment 4 Knut Johansson 2009-01-06 22:31:02 UTC
Unfortunately not. 

Just tried again, skipping the part about various artists and removing the one various artist tagged album from disk, the same problem is still there. The play-list gets seriously messed up.
Comment 5 Thomas H 2009-01-12 17:06:54 UTC
Created attachment 30196 [details]
screenshot messed up collection
Comment 6 Thomas H 2009-01-12 17:08:51 UTC
This also happens on 2.0.1.1. with ubuntu packages.
Comment 7 Björn 'Fuchs' Krombholz 2009-01-16 22:28:23 UTC
I can confirm this behaviour on 2.0.1.1.

I had an artist X with 2 albums a and b in my collection (organized as <artist>/<year>-<album>/<track-number>-<tracktitle> in the collection folder). Then I added another album c to the artist dir. After an "Update Collection" run, they were completely messed up. b was visible but had no tracks, a was visible but contained the tracks of a.

Loading the tracks of c with the file browser showed them as tracks of a. Album a in the playlist was listed with all tracks of b and c, the real tracks of a weren't visible.

Restarting amarok did mix it up a bit (real tracks of b showed up under album a with the cover of c; c was correct now with the same cover as b).

Rescanning the whole collection didn't help.
Comment 8 Alex Pillar 2009-01-23 01:08:24 UTC
I am also having this problem. I am running Amarok Version 2.0.1 on Fedora10 using KDE 4.1.3

After altering ID3 tags etc in Amarok, i find my Collection/Playlist gets really messed up. Virtually every track/artist/album is affected. 

Restarting Amarok / Rescanning Collection doesnt help. The only way ive found to fix it is to delete entire db and rebuild.
Comment 9 Andi Clemens 2009-01-31 13:58:13 UTC
Created attachment 30780 [details]
collection mixed up

KDE Version 	2.0-SVN (KDE 4.2.00 (KDE 4.2.0), Arch Linux)
Application 	Bugs and wishes related to the database, and to the scanning process
Operating System 	Linux (i686) release 2.6.28-ARCH
Compiler 	gcc



I have the same issue. I added some new files to my collection folder, and after that some artists are associated with wrong albums.
Nothing seems to fix it but deleting the database.
Comment 10 Tudor M. Pristavu 2009-02-21 19:49:25 UTC
*** This bug has been confirmed by popular vote. ***
Comment 11 hyper_ch 2009-02-24 20:51:44 UTC
Created attachment 31619 [details]
Amarok Collection Update Bug

I can confirm this.

Using ubuntu 8.10 with Amarok Neon:

Version 2.0-SVN-Neon
Using KDE 4.2.63 (KDE 4.2.63 (KDE 4.3 >= 20090212))

In the attachment you can see that songname and tags are Rammstein but it's listed under Nightwish. Same goes for a few other songs.
Comment 12 Mikko C. 2009-03-20 20:28:44 UTC
Created attachment 32294 [details]
Collection messed up

I made a *full rescan* (not update) and I hit this bug too.
I think it's pretty obvious from the screenshot: many artists are gone and "substituted" with the nearest artist alphabetically.
For example "Pink Floyd" is gone: "Pink Martini" takes their place.
I think this bug's priority should be increased since it's a pretty common issue.
Comment 13 Mikko C. 2009-03-26 15:42:32 UTC
*** Bug 188166 has been marked as a duplicate of this bug. ***
Comment 14 piemonkey 2009-05-01 16:04:28 UTC
I don't know about anyone else, but this seems to be fixed for me in 2.0.90 (KDE 4.2.2 (KDE 4.2.2), Kubuntu packages).

This might have been helped by the switch to Jaunty from Intrepid.

I've not tested it very extensively, but have both run a collection rescan and then added an album, and done a collection update, and it has worked so far.
Comment 15 Andi Clemens 2009-05-01 16:15:35 UTC
I use Archlinux with a nearly daily SVN snapshot of amarok, but the problem still exists for me.
Comment 16 Mikko C. 2009-05-01 16:31:38 UTC
> 
> I've not tested it very extensively, but have both run a collection rescan and
> then added an album, and done a collection update, and it has worked so far.

What triggers the bug here is a collection "rescan", not a simple collection update.
And it's not fixed in beta1 because it still happens in trunk.
Comment 17 piemonkey 2009-05-01 19:26:15 UTC
> ..have both run a collection rescan and...

I did do a rescan, after making some changes (I deleted an album and added at least one album). I then did an update after adding another album.

The reason I did the update as well was because up until this point that wasn't working for me either...

I have investigated further, by going back to my backup mysqle folder and running another rescan, this time there were some (only a few) mixed up albums, so it unfortunately must have been a one off the first time.

Good luck with fixing this.
Comment 18 Jeff Mitchell 2009-05-15 23:57:49 UTC
This is probably fixed in SVN now.  See bug 187126.  Re-open if it's not fixed...thanks.
Comment 19 Mikko C. 2009-05-16 11:35:49 UTC
I just tried adding two albums to my collection and did a *full rescan*, unfortunately this bug still persists: the effects are the same as described in my screenshot in comment #12.
Comment 20 Piotr 2009-05-16 18:54:17 UTC
I just played with the amarok's collection scaner in 2.1 Beta 2. The only annoyance i've discovered is that some albums are listed twice without messing up (that album's A title is in albums's B ). 

First thing is i removed one folder from the collection so it rescanned and some albums were listed twice. 
Then i added the album that i removed, it got added correctly but the albums that were listed twice stayed the same.
Also one album for no reason got other cover.
Comment 21 Piotr 2009-05-16 18:57:16 UTC
P.S. to comment #20, some albums are not listing anything at all.
Comment 22 Mikko C. 2009-05-17 09:18:10 UTC
*** Bug 192950 has been marked as a duplicate of this bug. ***
Comment 23 Mikko C. 2009-05-19 22:56:07 UTC
*** Bug 193288 has been marked as a duplicate of this bug. ***
Comment 24 Seb Ruiz 2009-05-22 14:39:41 UTC
*** Bug 176874 has been marked as a duplicate of this bug. ***
Comment 25 Seb Ruiz 2009-05-22 14:40:29 UTC
*** Bug 176290 has been marked as a duplicate of this bug. ***
Comment 26 Mikko C. 2009-05-26 21:40:13 UTC
*** Bug 194198 has been marked as a duplicate of this bug. ***
Comment 27 Mikko C. 2009-05-28 22:44:34 UTC
*** Bug 194472 has been marked as a duplicate of this bug. ***
Comment 28 Peter Paulsen 2009-05-29 14:24:06 UTC
I have deleted the whole database and amarok recreated it, fine so far. But then I again deleted one file - and the new database also gets messed up (adding tracks didn't do any harm to it as it seems). Not only the deleted track is still shown (in the collection count, not in the collection itself, Bug 194200), also the information of nearly all (!) other tracks got messed up, the only correct information is the name of the song. I have now tracks of artist A which are assigned to artist B and album of artist C. No track in the whole database has the correct information, except one! (good overview possible with a test database of 20 tracks)

Tracks of the same artist are still shown as tracks of the same artist but it's another artist now, no mixing of different artists, e.g. all songs by The Hooters are now shown as Metallica, all songs by Metallica are shown as The Dubliners. 

Songs from the same album are now still shown as from the same album but it's another album. E.g. there is one song in the database that belongs to the album "One". But now amarok has assigned two songs of The Dubliners to this album (which doesn't belong to Metallica anymore but to Santana).

It's not possible for me by now to recognize a pattern like all artists moved by two or three alphabetical entries or something like that.
Comment 29 Mikko C. 2009-06-12 08:37:22 UTC
*** Bug 196094 has been marked as a duplicate of this bug. ***
Comment 30 Myriam Schweingruber 2009-06-12 08:39:11 UTC
*** Bug 184888 has been marked as a duplicate of this bug. ***
Comment 31 Meho R 2009-06-22 15:39:57 UTC
Just to confirm the bug is still present in Amarok 2.1 and 2.1.1. I'm using Ubuntu Jaunty 64bit, Amarok installed from Kubuntu repo, KDE 4.2.4 (and KDE 4.3 beta). I don't know if it's relevant, but things get really messed up after using Organize files to move and rename some songs. After that, collection got messed, songs went to wrong artists, tags are screwed etc. (altough tags are messed up only "locally", in Amarok). Here's a forum post about this problem: http://amarok.kde.org/forum/index.php/topic,17151.0.html
Comment 32 Piotr 2009-06-22 15:49:49 UTC
Adding a folder with an album doesn't mess up the collection. For example i set Amarok to scan recursively folder music which contains album folders. So if i add a folder with music to the music folder amarok adds it with no problems at all.
Comment 33 Ash Hunter 2009-06-22 15:57:26 UTC
Just wondering if anyone with this problem has a full (or nearly full) root partition? I had the collection scanner mess up badly the other week, but since clearing out some of my log files to make some space it's been fine.
Comment 34 Andi Clemens 2009-06-22 16:02:33 UTC
My partition is still nearly empty, so no...
I can confirm this problem most of the time when adding files while amarok is running. Then it goes crazy and mixes up artists and albums.
Comment 35 Mikko C. 2009-06-22 16:50:35 UTC
this (In reply to comment #32)
> Adding a folder with an album doesn't mess up the collection. For example i set
> Amarok to scan recursively folder music which contains album folders. So if i
> add a folder with music to the music folder amarok adds it with no problems at
> all.

do you do a full rescan or just "update collection"?
for me it happens only with a full rescan
Comment 36 Piotr 2009-06-22 17:00:04 UTC
I didn't click anything, i do not use Amarok's collection scaner buttons. Right now i added a folder (by ticking it) with music from within the collection scanner's window and clicked apply, it scanned my whole collection and everything was fine. Also i left normal settings as watch folders for changes. So i have the most important folder MUSIC which contains music in their respective folder. If i add a folder with music to the MUSIC folder it scans it and adds to collection without messing anything up. When i for example cut the folder out Amarok doesn't see the change and won't start updating the collection (it's at least better than messing it up). If i add a music folder with amarok's own collection scanner settings window it messes everything up.
Comment 37 Piotr 2009-06-22 17:02:08 UTC
To add to my latest comment, if i add a music folder from within the collection scanner AND click rescan collection then it gets messed up.
Comment 38 Mikko C. 2009-06-22 17:13:25 UTC
(In reply to comment #37)
> To add to my latest comment, if i add a music folder from within the collection
> scanner AND click rescan collection then it gets messed up.

Yep, that's because a full rescan is triggered when you do so. This is also how I reproduce the bug.
Comment 39 Piotr 2009-06-22 17:21:47 UTC
Well it may be but if i add a music folder to the main MUSIC folder it looks as if it was scanning the whole folder like a complete rescan yet it won't mess up anything.
Comment 40 Piotr 2009-06-22 17:34:14 UTC
Then i think we should specify that right now doing a full rescan messes up the collection while if amarok is set to watch for changes it updates it with no problems at all. I understand it can't be set to remove the whole database when doing the full rescan since people want to keep their ratings right?? Also Amarok doesn't see the changes when a folder is removed. It stays in the database even though it may not exist there anymore.
Comment 41 Jeff Mitchell 2009-06-22 17:40:37 UTC
Piotr, Amarok relies on mtimes of folders to determine when a folder needs to be scanned. If it's not updating when you remove a folder, it's possible that whatever filesystem you're using isn't updating the parent folder's mtime.  You can use stat to check this, i.e. if you're in the root folder, do "stat .", then move the folder out, then do "stat ." again and see if the mtimes have changed.  Note that moving it elsewhere in the same folder is different behavior, so you have to move the folder out of that folder tree entirely.
Comment 42 Piotr 2009-06-22 17:55:21 UTC
Well as a matter of fact i did what you said, Access Modify and Change times changed when i cut the folder out and i pasted it outside and it was still in the database.

piotrek@linux-lsrn:/media/Everything> stat Music/
  File: `Music/'                                 
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: fd06h/64774d    Inode: 1074266245  Links: 42                 
Access: (0755/drwxr-xr-x)  Uid: ( 1000/ piotrek)   Gid: (  100/   users)
Access: 2009-06-22 16:58:27.669766937 +0200                             
Modify: 2009-06-22 16:58:27.640266961 +0200                             
Change: 2009-06-22 16:58:27.640266961 +0200                                  
piotrek@linux-lsrn:/media/Everything> stat Music/
  File: `Music/'                                 
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: fd06h/64774d    Inode: 1074266245  Links: 41                 
Access: (0755/drwxr-xr-x)  Uid: ( 1000/ piotrek)   Gid: (  100/   users)
Access: 2009-06-22 17:50:22.752773609 +0200                             
Modify: 2009-06-22 17:50:22.736368260 +0200                             
Change: 2009-06-22 17:50:22.736368260 +0200                             


The 17:50 time was after i cut the folder out and i waited a bit for Amarok to spot the difference yet it didn't do anything :)
Comment 43 Jeff Mitchell 2009-06-22 18:00:06 UTC
And you actually have it set to watch folders for changes?  Cause it WORKSFORME.
Comment 44 Piotr 2009-06-22 18:04:25 UTC
Maybe i should add some details. The MUSIC folder is on a LUKS encrypted partition which is formatted with XFS (no fancy fstab settings like atime, nodiratime or relatime), as You could see mtime changes and YES amarok is watching for changes what You can see in the link provided here http://www.imagebam.com/image/d9c0fc39809081
Comment 45 Piotr 2009-06-22 18:50:01 UTC
Hmm, as it turned out it works fine. I had accidentally set not the MUSIC folder to watch but the folders itself. So everything is fine except it gets messed up when an album is removed :D
Comment 46 Myriam Schweingruber 2009-06-22 22:35:29 UTC
What now? Close it, change the title? This whole discussion is not really helping to decide...Jeff?
Comment 47 missive 2009-06-23 01:48:19 UTC
Please do not close this bug.

I had my hopes on Bug 176154 being the fix, but that one is closed and this problem is still present.

What can we do to get this working? Would it help to have copies of the database from before and after the corruption?
Comment 48 Jeff Mitchell 2009-06-23 02:11:16 UTC
I think I know what's causing this, but it will take some time to fix.  Please leave the bug open for now; I'm working on it.
Comment 49 Mikko C. 2009-06-23 20:48:58 UTC
This should be now fixed thanks to Jeff, rev 985896 :)
Note that you should either do a full rescan or even better wipe the database.
Also, if after a rescan you see a weird situation (ex: http://imagebin.ca/view/kkXxve.html ) in the CollectionBrowser, try restarting Amarok before re-opening this bug. That is probably a bug in the CB, not related to this report.
Thanks
Comment 50 Mikko C. 2009-06-24 15:14:31 UTC
*** Bug 197044 has been marked as a duplicate of this bug. ***
Comment 51 missive 2009-06-25 22:31:02 UTC
This works for me. Thank you!

(the only problem I see is that I needed to restart Amarok for the new songs to show up in the collection. The new albums -- and some others around where they came in -- showed up empty until a restart. After that... nice :o)
Comment 52 Jeff Mitchell 2009-06-25 22:45:58 UTC
Yeah, that's a separate problem (and one that's currently beyond my ken, unfortunately).  Anything that goes away with a restart is not related to this bug.  :-)

Glad that it works for you (after you restart :-)  )
Comment 53 Mikko C. 2009-06-28 21:34:10 UTC
*** Bug 198209 has been marked as a duplicate of this bug. ***
Comment 54 Jeff Mitchell 2009-07-11 13:57:56 UTC
*** Bug 199739 has been marked as a duplicate of this bug. ***
Comment 55 Jeff Mitchell 2009-07-11 13:58:19 UTC
*** Bug 192027 has been marked as a duplicate of this bug. ***
Comment 56 Jeff Mitchell 2009-07-11 17:49:30 UTC
*** Bug 199388 has been marked as a duplicate of this bug. ***
Comment 57 Mikko C. 2009-08-04 13:57:04 UTC
*** Bug 202488 has been marked as a duplicate of this bug. ***
Comment 58 Peter Paulsen 2009-08-20 19:45:04 UTC
This bug is still present in Amarok 2.1.1! i just added a new folder to my collection and now my whole database with over 9000 files is totally messed up, artist, albums, tracks and cover art are mixed. I have to delete the whole database after adding one folder!
Comment 59 Myriam Schweingruber 2009-08-20 19:54:47 UTC
(In reply to comment #58)
> This bug is still present in Amarok 2.1.1! 

Well, of course, as this was fixed in Amarok 2.2-git, but nonetheless it is fixed.
Comment 60 Mikko C. 2009-09-04 14:47:52 UTC
*** Bug 206251 has been marked as a duplicate of this bug. ***
Comment 61 Alassane 2009-09-14 08:36:46 UTC
I experienced this bug on 2.2 beta just now.
Comment 62 Jeff Mitchell 2009-09-14 17:00:31 UTC
...which part of this bug? What is the *exact* behavior?
Comment 63 Alassane 2009-09-14 17:12:16 UTC
I was testing the UMS feature with my iRiver e100. After transfering some tracks to it with a custom file naming Scheme, I noticed that some tracks were missing from my collection database. I then used the rescan collection button and every thing was messed up. 
I don't experience if my iRiver isn't connected. maybe there it's linked. I'll test again this evening.
Comment 64 Jeff Mitchell 2009-09-14 17:20:26 UTC
Alejandro, please see #63...
Comment 65 Mikko C. 2009-09-17 19:15:43 UTC
*** Bug 207703 has been marked as a duplicate of this bug. ***
Comment 66 Arnout Boelens 2009-09-27 22:40:19 UTC
I am using Amarok Version 2.2-GIT-NEON Using KDE 4.2.2 on Debian and the bug is still there. I think the bug should be reopened.
Comment 67 Myriam Schweingruber 2009-09-28 00:26:48 UTC
This has only been fixed about 20 hours ago, so it is well possible that these changes have not arrived in the Neon build yet.
Comment 68 Jeff Mitchell 2009-09-28 02:50:49 UTC
Right. Also, if anyone has problems, I'm going to request that you open a new bug for it (and CC me). The reason is that there have been various problems that have been fixed caused by various causes and this catch-all bug isn't useful anymore now that its specific problem has been fixed.

Also, before you do it -- close Amarok and open it and see if the problem goes away. If so, make sure to note that in the bug report, becaues it changes which component the problem may lie in.