Watch for a filename length issue in iTunes

Feb 10, '05 08:59:00AM

Contributed by: jtphil

I've come across an extremely annoying bug with iTunes that cost me over an hour of my time this morning.

To back up my iTunes music library, I use a Smart playlist that automatically grabs any new music that I add. It's defined as "Date added is after [date]." At some point, I back up that playlist to DVDs using the "Burn playlist to disc" feature (which can handle backing up to multiple discs), and then reset the date in the Smart playlist definition. Simple and effective.

Except today. After I had burned two DVDs, iTunes balked on the third one with an error message to the effect that there was an invalid filename. But it didn't give me any indication of which track had the invalid name or what was wrong with it.

After following a few false leads, I found the problem: there is a limit of 255 characters to filenames on a DVD. When iTunes burns a track to DVD, it uses the track name and prepends a sequential number to it to create the filename on the disc. Thus, a track named "1. Allegro Energico" will end up on DVD as "001 1. Allegro Energico" (assuming it's the first track on that DVD). This is a simple way to make certain that there will be no duplicate filenames. Now iTunes enforces a 255 character limit on the length of a track name. The problem occurs when a track name is at or near that 255 character limit within iTunes. When it tries to prepend the sequential number, the name is now longer than the DVD's 255 character limit.

So why would I have a track with such a long name? Some CDs split an individual work into multiple tracks -- like the Richard Strauss tone poem Don Quixote, for example. When I import those tracks into iTunes, I tell it to join them together, so that during playback there won't be jarring pauses in the middle of the music. The problem is that iTunes then names the ensuing joined track by concatenating the names of all the component pieces.

Note to self: remember to shorten the track name when joining tracks.

Comments (14)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050207054238762