Bugzilla – Bug 2048
Library scan should not scan playlist files
Last modified: 2008-09-15 14:36:01 UTC
I've been seeing all sorts of "strange" (wrong!) behviour when scanning my music library so I decided to go back to basics and debug what's happening. I changed the location of my music directory and put just one album in their with the following structure: . `-- Lossless |-- Classical `-- Non-Classical |-- Artists | `-- Fleetwood Mac | `-- (1977) Rumours - Deluxe Edition | |-- Artwork_600dpi | |-- Disc 1 | `-- Disc 2 `-- Various The folders Disc 1 and Disc 2 contain the following files: Disc 1 |-- 01 - Second Hand News.flac |-- 02 - Dreams.flac |-- 03 - Never Going Back Again.flac |-- 04 - Don't Stop.flac |-- 05 - Go Your Own Way.flac |-- 06 - Songbird.flac |-- 07 - Silver Springs.flac |-- 08 - The Chain.flac |-- 09 - You Make Loving Fun.flac |-- 10 - I Don't Want To Know.flac |-- 11 - Oh Daddy.flac |-- 12 - Gold Dust Woman.flac |-- Fleetwood Mac - Rumours (Expanded & Remastered) - Disc 1 of 2_flac.m3u |-- Fleetwood Mac - Rumours (Expanded & Remastered) - Disc 1 of 2_wav.m3u |-- Rumours (Expanded & Remastered) - Disc 1 of 2.log |-- Rumours (Expanded & Remastered) - Disc 1 of 2_correctedGaps.cue |-- Rumours (Expanded & Remastered) - Disc 1 of 2_currentGaps.cue |-- Rumours (Expanded & Remastered) - Disc 1 of 2_leftoutGaps.cue |-- Rumours (Expanded & Remastered) - Disc 1 of 2_noncompliant.cue |-- fingerprint.txt |-- flac_encode.jpg |-- md5flac.txt `-- md5wav.txt Disc 2 |-- 01 - Second Hand News [Previously Unissued Outtake].flac |-- 02 - Dreams [Previously Unissued Outtake].flac |-- 03 - Brushes (Never Going Back Again) [Previously Unissued Outtake].flac |-- 04 - Don't Stop [Previously Unissued Outtake].flac |-- 05 - Go Your Own Way [Previously Unissued Outtake].flac |-- 06 - Songbird [Previously Unissued Outtake].flac |-- 07 - Silver Springs [Previously Unissued Outtake].flac |-- 08 - You Make Loving Fun [Previously Unissued Outtake].flac |-- 09 - Gold Dust Woman #1 [Previously Unissued Outtake].flac |-- 10 - Oh Daddy [Previously Unissued Outtake].flac |-- 11 - Think About It [Previously Unissued Outtake].flac |-- 12 - Never Going Back Again [Previously Unissued Early Demo].flac |-- 13 - Planets Of The Universe [Previously Unissued Early Demo].flac |-- 14 - Butter Cookie (Keep Me There) [Previously Unissued Early Demo].flac |-- 15 - Gold Dust Woman [Previously Unissued Early Demo].flac |-- 16 - Doesn't Anything Last [Previously Unissued Early Demo].flac |-- 17 - Mic The Screecher [Previously Unissued Jam Session].flac |-- 18 - For Duster (The Blues) [Previously Unissued Jam Session].flac |-- Fleetwood Mac - Rumours (Expanded & Remastered) - Disc 2 of 2_flac.m3u |-- Fleetwood Mac - Rumours (Expanded & Remastered) - Disc 2 of 2_wav.m3u |-- Rumours (Expanded & Remastered) - Disc 2 of 2.log |-- Rumours (Expanded & Remastered) - Disc 2 of 2_correctedGaps.cue |-- Rumours (Expanded & Remastered) - Disc 2 of 2_currentGaps.cue |-- Rumours (Expanded & Remastered) - Disc 2 of 2_leftoutGaps.cue |-- Rumours (Expanded & Remastered) - Disc 2 of 2_noncompliant.cue |-- fingerprint.txt |-- md5flac.txt |-- md5wav.txt `-- no_flac_encode.jpg_too_long_titles_screen_messed-up.txt As you can see, there are various playlist files in each directory (.cue and .m3u). All .flac files are tagged "correctly", e.g.: [robin@dude Disc 1]$ metaflac --list --block-type=VORBIS_COMMENT 01\ -\ Second\ Hand\ News.flac METADATA block #2 type: 4 (VORBIS_COMMENT) is last: false length: 333 vendor string: reference libFLAC 1.1.1 20041001 comments: 11 comment[0]: Title=Second Hand News comment[1]: Replaygain_track_peak=0.98846436 comment[2]: Replaygain_track_gain=-9.01 Db comment[3]: TRACKNUMBER=01 comment[4]: Album=Rumours - Deluxe Edition comment[5]: Artist=Fleetwood Mac comment[6]: Discnumber=1 comment[7]: Genre=Classic Rock comment[8]: Replaygain_album_gain=-7.71 Db comment[9]: Replaygain_album_peak=0.98852539 comment[10]: DATE=1977 Now, what I would expect to happen is that after scanning I would have one artist "Fleetwood Mac" and one album "Rumours - Deluxe Edition" with two discs, e.g. "Rumours - Deluxe Edition (Disc 1)" and "Rumours - Deluxe Edition (Disc 2)". What I actually see is two artists: (1977) Rumours - Deluxe Edition Fleetwood Mac If I click into the "artist" (1977) Rumours - Deluxe Edition I see two albums: Disc 1 & Disc 2. Neither of these contain any files. If I click into Fleetwood Mac I see four albums: Rumours - Deluxe Edition (Disc 1) Rumours - Deluxe Edition (Disc 2) Rumours (Expanded & Remastered) - Disc 1 of 2 Rumours (Expanded & Remastered) - Disc 2 of 2 The first two entries I would expect to see, and they contain the correct files (e.g. Second Hand News from Rumours - Deluxe Edition (Disc 1) by Fleetwood Mac) The 3rd and 4th entries are generated from the .cue files and contain just one song - in each case, the last track on the disc. If I browse albums, I see six albums: Disc 1 Disc 2 Rumours - Deluxe Edition (Disc 1) Rumours - Deluxe Edition (Disc 2) Rumours (Expanded & Remastered) - Disc 1 of 2 Rumours (Expanded & Remastered) - Disc 2 of 2 1, 2, 5, & 6 are from the .cue files; 3 & 4 are correct. One other thing I'm seeing - I have some old playlists in the playlist directory. I'm also seeing "phantom" albums created from these playlists. To sum up, I think all this mess would go away if slimserver completely ignored playlist files when re-scanning the music library. Playlists should only be checked when the are played and, even then, I don't think the contents should be added to the music library.
I decided to confirm this by commenting out .cue and .m3u in types.conf and restarting slimserver then re-scanning. Sure enough, with these types removed, I get one artist "Fleetwood Mac" and two albums "Rumours - Deluxe Edition (Disc 1)" and "Rumours - Deluxe Edition (Disc 2)".
I'd like to know how this can be done without reversing on all need to have playlists load quickly, accurately and collect metadata that some users seem to want loaded from their playlist files? Ideas welcome
When a playlist is selected, it should be scanned, and the metadata loaded from the DB for the files within the playlist. How does this affect how fast playlists are loaded?
The reading of metadata and parsing into the nice title format that the web UI uses can be rather intensive. This made it very slow at playing long playlists and was part of the motivation behind moving playlists into the db. scning the song references, potentially leads to the ability to store compactly as a list of id's (much as ITunes does for its playlists). Would be nice to avoid going back to reopen previous issues
KDF - If that is the case, then the db needs to recognize the track already exists in the so it is not added. Is this problem related to Bug 1372? Right now, playlists are corrupting my db - if I create playlists then many of albums will have duplicate entries. It is odd though, because playlists created in slimserver do not seem to create dublicate entries. Duplicates only seems to be created from playlists created in other programs (e.g., Media Center, WinAmp). To me the most logical thing would be have the library scanned prior to the playlists and then when the playlists are scanned, the program should attempt to find the tracks in the db. If it finds the track, it should create a pointer or whatever to it, and if not it can add it to the library and create a pointer for the playlist. Obviously, however I have no idea what is going on currently, or how hard this would be to accomplish, so if I am just talking out of my ass then I appologize in advance. -Steve
Ooops, sorry I forgot to add this: Alternatively, the program could either search for and remove dublicate file references or give the user the option to do so. -Steve
Fixed in subversion change 4247