Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Quickly find orphaned iTunes songs Apps
To identify all songs which no longer connect to file, simply go to the music library in iTunes, Select All, click on the list and move slightly as if dragging the songs to a play list. Hold the listing until a red oval appears showing the number of files, then let them drop back in the library. Presto, every song that is orphaned will appear with the gray statement mark to the left.

Now if you could only sort by that column to quickly eliminate all orphans!
    •    
  • Currently 4.43 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[32,661 views]  

Quickly find orphaned iTunes songs | 7 comments | Create New Account
Click here to return to the 'Quickly find orphaned iTunes songs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Quickly find orphaned iTunes songs
Authored by: fds on Dec 08, '06 07:52:52AM
Then we would not need scripts such as Super Remove Dead Tracks:
http://www.dougscripts.com/itunes/scripts/ss.php?sp=removedeadsuper

[ Reply to This | # ]
iTunes missing files PHP script
Authored by: karnat10 on Dec 09, '06 06:12:14PM
This PHP script prints a list of all files mentioned in the iTunes Library XML file which do not exist physically:


#!/usr/bin/php
<?php

$itml = fopen($_ENV['HOME'].'/Music/iTunes/iTunes Music Library.xml', 'r');

while($line = fgets($itml) )
{
	if(preg_match('/<key>Location<\/key><string>file:\/\/localhost(.*)<\/string>/', $line, $matches) )
	{
		$path = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', rawurldecode($matches[1]));

		if (!file_exists($path))
		{
			echo "$path\n";
		}
	}
}

?>


[ Reply to This | # ]
iTunes missing files PHP script
Authored by: deef on Dec 10, '06 09:50:43PM

I ran this script and it identified about 95% correctly, but it also listed about two dozen tracks that I'd added in the last week or so but which *are* still on my hard drive in the locations listed & which don't show up with exclamation points in iTunes.



[ Reply to This | # ]
Not the author, but...
Authored by: DougAdams on Dec 11, '06 08:55:56AM

The XML file is updated periodically, but always after iTunes quits. It is possible that the files you added hadn't yet been written out to the XML file, and therefore their file paths couldn't be located in the XML resulting in the false positives.

---
Doug's AppleScripts for iTunes
http://www.dougscripts.com/itunes/



[ Reply to This | # ]
Unlikely
Authored by: karnat10 on Dec 14, '06 06:33:19AM

Files not mentioned in the XML file will never appear in the script's output.

However, the paths in the XML file are encoded a bit funny - a combination of URL encoding and HTML entities. I guess the grandparent's problems come from my less than perfect decoding of the path.



[ Reply to This | # ]
Unlikely
Authored by: DougAdams on Dec 14, '06 06:47:35AM

The encoding of the location/file path is really moot. All one needs to determine are the <key>Location</key> tags for a track in the XML.

---
Doug's AppleScripts for iTunes
http://www.dougscripts.com/itunes/



[ Reply to This | # ]
And Here's an AppleScript That Does It
Authored by: DougAdams on Dec 14, '06 06:55:14AM
List MIAs will create a text file of all tracks in your main Library that have "missing value" as the value of location property.

---
Doug's AppleScripts for iTunes
http://www.dougscripts.com/itunes/

[ Reply to This | # ]