Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Any software that can rebuild iTunes songs lost to Unknown Artist/ Unknown Album

iTunes sent 80% of my songs (about 20000 songs of 475GB) into Unknown Artist/ Album folder. My songs were ripped in .WAV and .AIFF formats and residing in 1.5 TB external hard disk. I realise how to rebuild them manually (through 'locate and search' but it will take eternity to complete. I don’t have backup copy of my music file and I can’t re-import (ripping) them from the CDs.

Is there software that can rebuild songs from this Unknown artist/ album folder back to the Artist/Album folders on iTunes Media/Music/.... (or to any specified directory/folder).

All my itunes library files, music metadata are intact. Artwork, Album, Artist name and track number and song names, genres etc are showing on itunes GUI. This problem should be technically solvable by a program. Any help or pointer in the right direction will be appreciated.

Posted on Jan 2, 2012 3:17 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 6, 2012 9:31 AM

OK, here we have an album in my test library in the standard location for it...


User uploaded file


Now I'm going to simulate the disaster by renaming the folder containing the files as Unknown Artist\Unknown Album. Note how each track now shows the ! for missing tracks.


User uploaded file


Next I select the 12 tracks and run the FindTracks script.


User uploaded file


I've clicked No on the first prompt so that I can get track by track confirmation. Next I check that the correct path has been assumed for the media folder to be searched. Note this must be a parent folder of where the files actually are. The script may not guess this initial value correctly if content is split over multiple paths/drives instead of the standard iTunes layout.


User uploaded file


The script will search the following potential locations for each track:

  • <Media Folder>
  • <Media Folder>\<Album Artist>
  • <Media Folder>\<Album Artist>\<Album>
  • <Media Folder>\<Artist>
  • <Media Folder>\<Artist>\<Album>
  • <Media Folder>\<Album>
  • <Media Folder>\Compilations\<Album>
  • <Media Folder>\Music
  • <Media Folder>\Music\<Album Artist>
  • <Media Folder>\Music\<Album Artist>\<Album>
  • <Media Folder>\Music\<Artist>
  • <Media Folder>\Music\<Artist>\<Album>
  • <Media Folder>\Music\<Album>
  • <Media Folder>\Music\Compilations\<Album>
  • <Media Folder>\Music\Unknown Artist\Unknown Album
  • <Media Folder>\Unknown Artist\Unknown Album

With optimizations when <Album>=<Album Artist>=<Artist>. For all searches outside of the Unknown Artist\Unknown Album folder there is a fuzzy matching mechanism which can cope with, for example, longer/truncated file & folder names or different filename character substitutions. Other types of media will be searched for in their usual locations relative to the media folder.

(Note to self: Add in ability to cope with missing track numbers)


Having confirmed the media location the script comes back with the first proposed correction. Yes will update the location of the track, No will skip that track, and Cancel aborts the script.


User uploaded file


After all the tracks have been processed, or you press Cancel, there is a summary of the activity. Obviously confirming each track one at a time would be boring so once you've proved the script is effective it is time to run it on larger groups of files in automatic mode which will display a progress bar so you can see that it is still working. If you close the progress bar the script will safely complete its current operation and then offer to abort or resume.


User uploaded file


tt2

45 replies
Sort By: 
Question marked as Top-ranking reply

Jan 6, 2012 9:31 AM in response to turingtest2

OK, here we have an album in my test library in the standard location for it...


User uploaded file


Now I'm going to simulate the disaster by renaming the folder containing the files as Unknown Artist\Unknown Album. Note how each track now shows the ! for missing tracks.


User uploaded file


Next I select the 12 tracks and run the FindTracks script.


User uploaded file


I've clicked No on the first prompt so that I can get track by track confirmation. Next I check that the correct path has been assumed for the media folder to be searched. Note this must be a parent folder of where the files actually are. The script may not guess this initial value correctly if content is split over multiple paths/drives instead of the standard iTunes layout.


User uploaded file


The script will search the following potential locations for each track:

  • <Media Folder>
  • <Media Folder>\<Album Artist>
  • <Media Folder>\<Album Artist>\<Album>
  • <Media Folder>\<Artist>
  • <Media Folder>\<Artist>\<Album>
  • <Media Folder>\<Album>
  • <Media Folder>\Compilations\<Album>
  • <Media Folder>\Music
  • <Media Folder>\Music\<Album Artist>
  • <Media Folder>\Music\<Album Artist>\<Album>
  • <Media Folder>\Music\<Artist>
  • <Media Folder>\Music\<Artist>\<Album>
  • <Media Folder>\Music\<Album>
  • <Media Folder>\Music\Compilations\<Album>
  • <Media Folder>\Music\Unknown Artist\Unknown Album
  • <Media Folder>\Unknown Artist\Unknown Album

With optimizations when <Album>=<Album Artist>=<Artist>. For all searches outside of the Unknown Artist\Unknown Album folder there is a fuzzy matching mechanism which can cope with, for example, longer/truncated file & folder names or different filename character substitutions. Other types of media will be searched for in their usual locations relative to the media folder.

(Note to self: Add in ability to cope with missing track numbers)


Having confirmed the media location the script comes back with the first proposed correction. Yes will update the location of the track, No will skip that track, and Cancel aborts the script.


User uploaded file


After all the tracks have been processed, or you press Cancel, there is a summary of the activity. Obviously confirming each track one at a time would be boring so once you've proved the script is effective it is time to run it on larger groups of files in automatic mode which will display a progress bar so you can see that it is still working. If you close the progress bar the script will safely complete its current operation and then offer to abort or resume.


User uploaded file


tt2

Reply

Jan 7, 2012 5:11 PM in response to turingtest2

1428 songs were recovered with FindTracks using iTunes Library #1. And they were returned properly into \Music\Artist\Album and Music\Compilations\Album


I passed the remaining Unknown songs to FindTracks using iTunes Library #2 and the 1542 recovered songs were returned into a mix of \iTunes Media\Artist\Album and iTunes Media\Music\Artist\Album. Can you please limit FindTracks search and return within the following paths:

  • <Media Folder>\Music
  • <Media Folder>\Music\<Album Artist>
  • <Media Folder>\Music\<Album Artist>\<Album>
  • <Media Folder>\Music\<Artist>
  • <Media Folder>\Music\<Artist>\<Album>
  • <Media Folder>\Music\<Album>
  • <Media Folder>\Music\Compilations\<Album>
  • <Media Folder>\Music\Unknown Artist\Unknown Album


I guess that might avoid the return of some wild potential matches which required me to choose one of them before FindTracks continued. A max of 7 potential matches was provided and in some instances none actually matched (since the max was 7). 7 is quite wild. What identifiers in addition to tracknumber and songname did you use? size (+/-)?, tracklength (+/-)?, trackcount (i.e. 1 of 15)?, discnumber (i.e. 1 of 1, 1of 2)?

Reply

Jan 6, 2012 9:25 AM in response to turingtest2

Yeah it worked!. I had to close the itunes, Reset to Default C:\ and back in with the designated F:\iTunes Media. It seems there is no other easy way to reconnect or refresh the link other than that.


Though I have just tried on 1 album, it should work on the rest. I have learnt a few other things that publications and community members can't teach anyone unless one actually tried them out. I know I'm not through yet but I have a good glimpse of hope.


I remain grateful.

Reply

Jan 7, 2012 5:31 PM in response to thelovelyman

Since, in principle, you're only interested in picking up stuff from the Unknown Artist\Unknown Album folder, use this folder as the root for the search. Will avoid all the blind alleys. About to sleep or I'd test it out but that ought to work. The matching is all done on filename using something called Soundex coding. Again too tired to go into detail now, but it does seem that I could use the filesize property to exclude false matches in a future version..


tt2

Reply

Jan 4, 2012 12:25 PM in response to thelovelyman

If the tracks are obviously duplicates of the same song in both the iTunes GUI and the folder that isn't so much of a problem. I was thinking more of this scenario:


User uploaded file


Where what should be three potentially different takes of the same song also have the same track number on their respective albums. As a result, following a similar accident to yours, they would be called "04 Ziggy Stardust.wav", "04 Ziggy Stardust 2.wav" & "04 Ziggy Stardust 3.wav". Using the size to confim the identity is easy enough to do by eye and I could implement that in my script at some point, but I'm thinking I need to turn off the fuzzy pattern matching system that could test for there being more than one potential match in the same folder as with 20,000 files it would run too slowly. Instead I've tweaked the script so that only look for a single precise match in the Unknown Artist\Unknown Album folder for the sake of efficiency.


The result of running the revised script on the selection above would be that all three tracks would be connected to the same file (if iTunes doesn't move them after they have been reconnected) or they might be connected in the wrong order. Just in case, use the Find Duplicates tool first, put the library in name order, and manually relink any same track name & number occurrences. Also take a backup copy of your iTunes Library.itl file before you proceed any further.


I've done tweaking and testing the new build of FindTracks which should now be able to sort things out for you. I strongly recommend you disable the option to "Keep iTunes Media folder organized" for now. You can re-enable it once the script has done its work so that iTunes can reorganize the files back in their proper folders, then disable it again to avoid a similar problem in future. I have a script called ConsolidateByMoving that you can use on selected items instead. I also suggest you take a look at my User Tip on backing up.


Select a few broken tracks for the first pass, say no to the first prompt, confirm the media folder then check each "correction" before it happens. If that's good try a larger batch on automatic. Still good? Set the rest in motion and give it some time.


tt2

Reply

May 29, 2014 6:52 AM in response to turingtest2

hi tt2,


i was reallly sweating it out until i found this thread. describes my problem exactly. was thrilled to find the FindTracks script. my only issue is that when i use the script, no matter what i try, i get back the following...


User uploaded file

I've tried the script on an XP and Win 8 machine with the same results. Any advice?

Reply

May 30, 2014 5:01 AM in response to turingtest2

tt2


I downloaded the latest version of the script. I continue to get the error, Line 508.


Here's a shot of ITunes before the run:User uploaded file


Here's a shot of the Explorer file location of the actual song file:

User uploaded file


Here's a shot of the Script run:

User uploaded file


And here's a shot of the error:

User uploaded file


Might it have something to do with the various file locations and expectations of the script?


Much thanks in advance,

Dow

Reply

May 30, 2014 9:25 AM in response to turingtest2

Turns out I was using version 12. I promise I'm not trying to be difficult but no matter how I try to access the script, either through your direct link above, or your website, I only get version 12!


User uploaded file


It's a brand new computer, no cookie problem. Tried two different browsers, just in case. Got the same problem! 😕

Reply

Sep 2, 2016 9:06 AM in response to turingtest2

I got the playlists set up. I tried to run the script again to see if I could change the location to search, but it didn't give me an option. This is the only box that pops up when I double click the script icon on my desktop.


User uploaded file


If I click No so each track will pop up it asks me if I want to add each file it finds to the found playlist with the file path (iTunes\Music\<Artist>\<Album>\<Song>). If I click Yes it runs through all the tracks automatically and gives me the result that 241 tracks were found. Do I possibly have an older version? I just pulled it off the website yesterday.

Reply

Sep 2, 2016 9:25 AM in response to Guns of August

You have the current version. The script should work with selected tracks if you select them first.


Alternatively edit line 116 from:

Source="Library" ' Named playlist to process, use "Library" for entire library

to:

Source="" ' Named playlist to process, use "Library" for entire library


So that it reverts to the current playlist instead of the whole library if you haven't made a selection.


Answer Yes to the first prompt, the second prompt will show the path to the media folder that it will search. It should look something like this:

User uploaded file

tt2

Reply

Sep 2, 2016 3:27 PM in response to turingtest2

For some reason the script that I downloaded was apparently different than the text of the one on the website. I copied and pasted the text manually into the script and it seems to be working now. I get the second prompt to choose the location now. I'm working my way through each folder and hopefully will be able to connect most of the broken links.


The following message has popped up several times in the process. I've just hit OK each time and the script continues to run.


User uploaded file

Reply

May 30, 2014 4:07 PM in response to dowfrommd

You're welcome. 🙂


I'd let iTunes tidy up by enabling Keep iTunes Media folder organized. It will be faster than my script.


As you've probably discovered .wav files are particularly tricky if you lose your library database as they don't have a tag to store metadata. See this backup tip if you haven't already sorted that out.


You might want to consider converting the files to AIFF or Apple Lossless unless you need the .wavs for some other application. My script ConvertFormat can help with this task.


tt2

Reply

Jan 2, 2012 5:28 PM in response to thelovelyman

The downside with WAV files as a media format is that they don't retain tag information. AIFF files however ought to contain a tag which can hold details such as track number, name, artist & album even if some more esoteric fields aren't preserved.


If iTunes wasn't managing your file & folder names when whatever "accident" happened then most of the important information could have been recovered from the paths, but if I read you right the tracks are no longer connected to iTunes and have also been jumbled up in the Unknown Artist\Unknown Album folder. You can't undo that loss of data. The tools that could identify the tracks from their audio fingerprints, such as MusicBrainz Picard, won't work since they can't write the information to a non-existent tag.


Offhand I don't think there is any easy way back from the mess.... 😟


tt2

Reply

Jan 3, 2012 9:29 AM in response to turingtest2

@ turingtest2: Thanks.


I am thinking since it is possible to manually rebuild the jumbled songs (through 'locate and search') back into the appropriate itunes Artist/ Album folder, there should be a way to automate the manual process.


I just need a written code that can search the songs in the Unknown Artist/ Album and match the songs with the itunes Library database (which I believe are still intact) and restore it for me (instead of me doing it manually). At least I rebuilt one album manually....and I think rebuilding one album wouldnt have been possible if required tags or metadata info necessary are lost.


The logic needed (which is subject refining) is:


Pick a song in the Unkown Artist/ Unknown Album folder,

Get the song's information (i.e. name of song, size in MB, length of play, date modified, song format ie. .wav or .aiff);

Match the information with that in the itunes database (size, length of play, song format, album name, artist name);

return the matched song to the corresponding Artist/ album to a specified location/directory

Repeat

End


That is pretty much what I did manually.


I am not looking for a tool that will use any database (or tags) outside what is residing on my computer. I need someone who can put my logic into a code. And if there is something that i have not put into consideration for my logic to work, I like someone to enlighten me e.g if iTunes had protected its Library database from being searched with a written code.


If my logic can work and the itunes database can be searched, I want to believe someone somewhere must have written and use such a code. And if not someone can write it. Programmers, where are you?

Reply

Jan 3, 2012 10:10 AM in response to thelovelyman

thelovelyman wrote:


Programmers, where are you?


Well I'm here. I was about to say that I still wasn't optimistic but as long as the files are in a ## <Name> format that gives us a fighting chance. The number of occassions when a given combination of track number and track name appears on more than one album isn't that high, but it certainly happens. Thankfully I've just discovered that I I can read the size of the missing file from the database, even if I can't read the last known location, so chances are that there is something I can do after all. I shall need to think about it a bit...


tt2

Reply

Any software that can rebuild iTunes songs lost to Unknown Artist/ Unknown Album

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.