Tuesday December 11, 2001
I've been digitizing my CD collection. One problem I ran into arises when the internet connection is down and iTunes can't get the CDDB track info and saves the mp3s as "unknown artist/unknown album/Track ##". Once you're back on the net you can highlight the tracks and instruct iTunes to update the track info, but the odd part is that it only updates the ID3 tag in the MP3 file. The mp3 remains badly named (i.e. "Track 07 1.mp3") and in the Unknown Artist/Unknown Album folder. Last night I wrote my first OSX perl script to correct this. It uses the module MP3::Info to read an "unknown" file's ID3 info in order to rename and move the mp3 to a more fitting directory structure.

In the process I found a bug of sorts with iTunes...or would it be a music industry bug? iTunes preserves the names of songs as it turns them into files. Well, one of my CDs has the unfortunate name of "...To the power of three" which, if you are familiar with unix, means it's a hidden file. The finder in OSX doesn't show the directory, but iTunes sees it no problem (drove me nuts for a while).

Even if you don't use/need my script it is fun to play around with the MP3::Info module. I haven't tested this hypothesis, but I think iTunes must be storing the disc ID into an ID3 tag area when it can't get a CDDB connection. This would make it easy to later look up the CDDB Info and "add" the tag info without much effort.

(time passes...) Yep, that's what they are doing. iTunes stores the CDDB "keys" in a COMMENT array within an otherwise almost empty ID3 tag. Clever.