Itunes duplicate finder1/5/2024 ![]() ![]() Alternatively, a faster mode is achieved by parsing the iTunes Library.xml file. Unfortunately, that can be slow for a large library. It can use the iTunes COM interface to iterate through each track-in the same manner as your sample code. There are options to use either of two strategies to find dead tracks. ITunes Toolkit (of which I am the author) is a free program that has a function for finding and either repairing or deleting dead tracks. Big thanks to Shawn at ScarTech for saving me my evening and for tidying up my iTunes. You can download Shawn's code here but as he hasn't blogged in a LONG time, I've mirrored it at SkyDrive. ![]() I'd also encourage you to check out the second part of Shawn's iTunes and C# tutorial series where he creates a duplicate finder that knows to keep the higher bitrate song. Looks like it checked 7219 tracks and removed 570 dead ones. If (fileTrack.Location = String.Empty || !System.IO.File.Exists(fileTrack.Location)) if the file doesn’t exist, we’ll delete it from iTunes IITFileOrCDTrack fileTrack = (IITFileOrCDTrack)track If (track.Kind = ITTrackKind.ITTrackKindFile) get a reference to the collection of all tracks ITunesAppClass iTunes = new iTunesAppClass() Also, I'm on 64-bit and his COM code expects x86, so I changed the project properties from An圜PU to x86 and it worked great. ![]() His stuff was written using Visual Studio Express 2008, but I upgraded to 2010. Here's a bit of his code, using the iTunes COM SDK. Instead, I sat down tonight and decided to write a script in C# that said something like "foreach track, does that track exist where the system thinks it should be? No? Delete it."Ī little googling with Bing, however, brought me to a three year old post at ScarTech where Shawn (shame he's stopped blogging) did the code for me! Yay. In my case, removing dupes was easy, but yanking dead tracks isn't worth me spending money. There's a MILLION stupid little shareware apps that purport to fix duplicates and remove dead tracks. This solution wasn't cool for me so I say, nay nay. It'll add just files that exist, but you will lose any edits, artwork, etc, you may have added. Now, as a napalm-style solution, you CAN delete your iTunes library completely and re-add it. However, this then left me with a big iTunes database that THINKS it has music, even though the file on disk is long gone. I searched for *1.mp3 and *2.mp3, etc, and deleted the dupes on disk. It was taking up many gigs of duplicate space. I ended up with "LL Cool J - I Need Love 1.mp3" and "LL Cool J - I Need Love 2.mp3" along side the original. But enough about Satan, let's yank some dead tracks, shall we?Īt some point, I ended up with hundreds of dead tracks and/or duplicates. ![]() I could manage all my music with Zune (and I do have a Zune Pass for leasing music I don't want to buy) but there are iDevices in the house and iTunes is what it takes.ĭid I mention it sucks? It's slow, frustrating, and is effectively just a giant listbox that exists only to mess up my music library and occasionally try to sneak Safari and QuickTime onto my machines. I'm sure it's all unicorns and spun sugar on MAC, but as a guy using Windows with dozens of gigabytes of music on a shared file server that I've ripped since the first CD I ever purchased, it's hell on earth. It is a pox on my existence and it has cost me hours of pain and suffering. I hate iTunes on Windows with the heat of a thousand suns. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |