Hi All, I've had a long standing problem with track count mismatches between iTunes and SC - mainly related to the fact that iTunes is case insensitive and accent sensitive while SC appears to be case sensitive and tends to strip accents from path names (see http://bugs.slimdevices.com/show_bug.cgi?id=4892)
Anyway, this problem finally reached the point that I was irritated enough to do something about it. As my perl-fu is not up to scratch at the moment, I have written a quick VBscript to scan the iTunes library (attached below). The scan looks for file paths containing accents (resolution is to remove the accent from the tune name in iTunes) and iTunes file paths that have a different capitalization to the actual file path (normally occurs with multiple albums by one artist - make sure the capitalization of the artist is consistent across albums in iTunes). Anyway, I hope this is useful for other Squeezecenter users mixing up Windows iTunes and Linux Squeezecenter. Cheers, Laz ' script begins - save as CheckItunesFiles.vbs Option Explicit ' If the script engine is WScript,next lines will execute the script again using ' CScript and exit from the current WScript script. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If InStr(1,WScript.FullName, "wscript", 1) Then CreateObject("WScript.Shell").Run "cscript.exe //NoLogo """ _ & WScript.ScriptFullName & """", 1, False WScript.Quit End If '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dim objFS Dim objFile Dim objItunes dim objTracks Dim strItunesName Dim strActualName Dim boolMismatchFound dim strAccents dim strRemoveAccents dim i dim j ' Set objFS = Wscript.CreateObject("Scripting.FileSystemObject") set objItunes = wscript.createobject("Itunes.Application") set objTracks = objItunes.LibraryPlaylist.Tracks boolMismatchFound = False strAccents = array("À", "Á", "Â", "Ã", "Ä", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ñ", _ "Ò", "Ó", "Ô", "Õ", "Ö", "Ù", "Ú", "Û", "Ü", "ß", "à", "á", "â", "ã", "ä", "ç", "è", _ "é", "ê", "ë", "ì", "í", "î", "ï", "ñ", "ò", "ó", "ô", "õ", "ö", "ù", "ú", "û", "ü") strRemoveAccents = array("A", "A", "A", "A", "A", "C", "E", "E", "E", "E", "I", "I", "I", "I", "N", "O", "O", "O", "O", "O", "U", "U", "U", "U", "ss", "a", "a", "a", "a", "a", "c", "e", "e", "e", "e", "i", "i", "i", "i", "n", "o", "o", "o", "o", "o", "u", "u", "u", "u") for i = 1 to objTracks.Count strItunesName = objTracks.Item(i).Location ' strItunesName = "M:\iTunes\iTunes Music\rcade Fire\Funeral\02 Neighborhood #2 (Laïka).mp3" ' wscript.stdout.writeline i & ", " & strItunesName if objFS.fileexists(strItunesName) then set objFile = objFS.GetFile(strItunesName) strActualName= objfile.path ' wscript.stdout.writeline strActualName if strcomp(strItunesName, strActualName, vbBinaryCompare) <> 0 then If not boolMismatchFound then boolMismatchFound = True end if wscript.stdout.Writeline "Path case errors: " & strItunesName else for j = 0 to ubound(strAccents) if instr(strItunesName, strAccents(j)) then If not boolMismatchFound then boolMismatchFound = True end if wscript.stdout.Writeline "Path contains accents: " & strItunesName ' strItunesName = replace(strItunesName, strAccents(q), strRemoveAccents(q)) exit for end if next ' j end if else If not boolMismatchFound then wscript.stdout.Writeline "Mismatch(es) found" boolMismatchFound = True end if wscript.stdout.Writeline "Missing file: " & strItunesName end if next ' i if not boolMismatchfound then wscript.stdout.writeline "No mismatches found." end if wscript.stdout.write "Hit enter to continue." wscript.stdin.readline set objFS = nothing set objFile = nothing Set objItunes = nothing Set objTracks = nothing -- Laz ------------------------------------------------------------------------ Laz's Profile: http://forums.slimdevices.com/member.php?userid=427 View this thread: http://forums.slimdevices.com/showthread.php?t=53690
_______________________________________________ discuss mailing list discuss@lists.slimdevices.com http://lists.slimdevices.com/lists/listinfo/discuss