View Full Version : Apostrophe in song title causes duplicate listing?!

2006-07-09, 13:54
Hi all,

So, something weird is going on. My MP3/AAC library (managed in iTunes) has 1655 songs, but SlimServer is reporting 1878 songs. The duplicates are *really* duplicated, i.e. the song URL is identical as shown on the SongInfo page.

I've tried trashing both the slimserverdb.sql *and* the "iTunes Music Library.xml" files, and even rebuilding the entire iTunes library from scratch. Neither one helped.

I've narrowed down the duplicates to songs that have apostrophes in their titles (e.g. "Everybody's Changing" or "Boys Don't Cry"). For whatever reason, Slimserver is counting and cataloging *ALL* of those songs TWICE... they are listed twice in the song listings, so they end up playing twice as well.

The really weird thing is, I'm running the exact same version of SS on a different computer (with my ALAC library, ALSO managed in iTunes) and this bug does *NOT* happen there! My preferences are identical on the two computers, the only differences between them are that the affected computer is using an MP3/AAC library instead of ALAC and is running older versions of iTunes and QT.

On the affected computer, I'm running SS 6.2.2 (build 7135 [release]), MacOS X 10.3.9, iTunes 4.7.1, QuickTime 6.5. On the NON-affected computer, I'm running the same SS version, the same OS X version, but iTunes 6.0.4 and QuickTime 7.0.4.

Could SS have some incompatibility with the older version of iTunes and not the newer one? Note that iTunes *DOES* report the correct number of songs in all cases... it's ONLY SlimServer that reports dupes, and trashing both the iTunes and SS files is of no help. This is a totally reproducible bug.

It appears that perhaps the iTunes .xml file is slightly different between v4.x and v6.x, and SS is having problems with the v4.x format. If this is indeed the case, I really hope this can be fixed in SS because I don't want to upgrade iTunes on this computer (for various reasons).

I can provide screenshots if needed... any help would be greatly appreciated!

2006-07-09, 14:25
I have seen issues with the filepath/filename of tracks with punctuation marks, foreign chars, etc. Check the full filenames and paths and remove any "weird" characters ; tags should be treated ok.

2006-07-10, 17:02
I have seen issues with the filepath/filename of tracks with punctuation marks, foreign chars, etc. Check the full filenames and paths and remove any "weird" characters ; tags should be treated ok.

Thanks for the suggestion, but I don't think that's the issue. On the NON-affected computer, there are plenty of apostrophes in the folder/file names, and those don't seem to cause the problem. Both of the machines are running the same versions of both OS X and SlimServer, so if it were a filename-related issue (i.e. something related to the file system, totally independent of iTunes and QT), then both machines would suffer from it. However, only one machine is affected, and therefore I suspect that it's an incompatibility between SS and iTunes v4.x rather than a file-system-related issue.

I understand tags *should* be treated OK, but it's quite possible (I have no idea) that there's some difference between how iTunes v4.x and v6.x treat tags and/or the .xml library file, and that SlimServer is having problems when parsing those tags and/or the .xml file from v4.x.

That's really the only possibility that I can think of that makes sense, and if that IS the case then hopefully SS can be fixed to become compatible with both software versions.

Has anyone else seen this issue who uses iTunes v4.x (or any other version of iTunes)?

2006-07-11, 15:16
An update to this:

This bug occurs when an apostrophe is in *any* of the following tags: song title, artist name, album title. SlimServer shows duplicate listings for any song that has an apostrophe in any of the above.

The prime example was something like "Everybody's Changing" by Keane on the "Hopes and Fears" album. But, the same duplication happens with ALL songs by Guns 'n' Roses, for example, regardless of song or album title. Similarly, all songs on Billie Holiday's "Billie's Best" album are duplicated, regardless of song title.

Also note that duplication only occurs once per song, regardless of the number of apostrophes, i.e. even if there are multiple apostrophes in the song title (or apostrophes in multiple fields like song title and album title), the song is still listed exactly twice.

Anyone with more info and/or a fix for this?

I'll probably post this in bugzilla soon.

2006-08-11, 20:43
Blarg, the system just ate my earlier post. Short and sweet version:

I had this problem and fixed it. Problem was exactly as described, single quotes in song titles or in album names caused duplicate display in, e.g., album song lists. Super annoying. Always two appearances of the culprit - never 3. Examining the URL of the "twins" showed the filenames were identical.

I have tried to attach a jpg showing the problem.

My setup: server 6.3, SB 2, 2 slimp3's, macos 10.4. Simple rebuilds of the sqlite db (or manual deletion followed by rebuild) did not solve.

My music files are in /Users/Shared/Music. My home dir, /Users/my-login/Music/iTunes, is symlinked into /Users/Shared/Music.

On closer inspection of my settings, I found the problem was, I gave the slimserver two ways to find my music files.

I told it to "use iTunes" to find my music library (hence telling it to follow the second path named above) as well as manually specifying the path to my music via the "Music Folder" option (and I gave it the first path named above).

I think the server might have gone down both paths to add files in. And furthermore, I think there is some code in there that is normalizing the file names to avoid dupes due to symlinks, and that that code is failing for pathnames containing single quotes. The code bit is clever, but IMHO this is a bug -- if the code bit had not been there, the problem would have been a lot easier to diagnose. I'm not saying remove the code bit, just make it work properly.

Incidentally, I seem to remember earlier versions of slimserver did not follow symlinks properly so you had to specify the root music folder manually.

Hope this helps.

2006-09-13, 15:35
turmon, this may very well be the case. I was going to reply and disagree with you because I have the "exact same setup" on my G4 tower where this duplication is not occurring... but I realized that my setup there is subtly different in exactly the way you're posting.

Specifically, on the G4 tower, my files are stored on an external hard disk, /Volumes/LACIE/Music ... however, my home directoy music folder (/Users/cepheid/Music) is *NOT* aliased to the external drive. Instead, I have told iTunes (via Preferences) where to store the music, but I still allow it to store its database and other info in the usual home directory music folder.

In SlimServer, I have told it to use iTunes and specified that my music folder is /Users/cepheid/Music, which has NO music files so there can be no duplicates if indeed SlimServer is behaving the way you surmise.

On my laptop where this duplication bug IS occurring, my music is in /Users/cepheid/Music and both iTunes and SS are accessing it there, so it's very possible that this is why the duplication occurs there and not on the tower.

I have been too lazy to submit this to bugzilla but it looks like perhaps I should, since this seems like it could affect pretty much anyone who uses both iTunes and SS on a Mac.

(Incidentally, the reason that my home music folder isn't aliased on the tower is because SS refuses to start up if the folder specified as the Music folder in SS is an alias... SS doesn't seem to like aliases. I have not tried using a symlink rather than an alias, though from your post I guess that appears to work.)