iPod Sync Question

Thursday, December 2nd, 2004 @ 10:35 pm | iPod

Hmm. Somehow, my iTunes library got corrupted. It looks like iTunes tries to rebuild its library file from the iTunes Music Library.xml file, which is cool, in theory. For some reason, it appears my iTunes Music Library.xml was a bit out of date, as a iTunes is missing a number of songs.

It looks like the songs are still in my Music folder, which is the good news. If I remember correctly, simply dragging said folder onto iTunes should import the missing songs while ignoring the songs already present in iTunes. However, I’d like to confirm that it’s just the database that’s corrupted and that no songs have actually been deleted.

The easiest thing I can think of is to check the number of songs iTunes thinks are in my Music folder to the number it thinks are on my iPod. Unfortunately, I’ve got my iPod set up to sync as soon as it connects. Does anybody know a way I can connect my iPod to my computer and not have it automatically sync? I don’t think it’s possible to access the sync preferences when the iPod’s not connected.

My fallback plan is to connect the iPod to a second computer, but that will make it slightly more difficult if I need to move songs off the iPod.

Update: It looks like I’m OK, track-wise. In case this happens in the future, I’ve come up with two ways of checking for discrepancies between my iPod and my music library. Both ways start with the same steps:

  1. Reimport all of your music into iTunes. For me, “reimport” meant “drag your Music folder onto the iTunes window and let iTunes figure out which songs it needs to add.”

  2. Get the List MIAs script from Doug’s AppleScripts for iTunes site, install it into ~/Library/iTunes/Scripts, and run. Investigate any tracks for which iTunes can’t find a corresponding file. In my case, I had about half a dozen files that I’d intentionally deleted and another handful of files that iTunes didn’t see and insisted on reimporting.

Here’s where things diverge. There’s the quick, but slightly messier, version or the time consuming, but cleaner, version.

First, quick and dirty.

  1. Make sure your iTunes Music Library.xml file is up to date. I did this by deleting the file, launching iTunes, and quitting iTunes.

  2. Connect iPod.

  3. Force Quit iTunes while it’s launching to prevent the contents of your iPod from getting blown away (yup, that’s the dirty part).

    **Update**: Looks like there’s a better way, at least in later versions of iTunes: hold down the Command and Option keys while connecting your iPod. (Shift-Control on Windows.)

  4. Get PodWorks. Launch PodWorks. Under the Pod menu, select “Show Only Songs Not In iTunes.” Investigate any missing tracks and copy them over to you computer as necessary. In my case, I had 2 tracks I’d deleted and 2 tracks I’d moved, so everything look clean. (yup, that’s the quick part).

If I could just figure out a way to prevent iTunes from trying to sync without force quitting the application, this would be the ultimate solution.

Now, time consuming and clean.

  1. Open the file ~/Library/Preferences/com.apple.iPod.plist. Find the information concerning your iPod and get the last sync date.

  2. In iTunes, create a new smart playlist searching for all tracks added before your last sync date and tracks added the day your reimported your files into iTunes.

  3. See if the number of tracks in the playlist matches the number of track on your iPod by navigating to Settings > About.

  4. If the numbers match, you’re probably all set. If not, have fun comparing the contents of you iPod to the contents of the playlist :/

There’s one other possibility that I didn’t test, but might work. It’s a modification of the quick and dirty steps from above.

  1. Make sure your iTunes Music Library.xml file is up to date.

  2. Copy PodWorks and your iTunes Music Library.xml file to a second Mac.

  3. Launch PodWorks, open the Preferences, and tell PodWorks to use your copied iTunes Music Library.xml file instead of the default file.

  4. Connect your iPod to the second computer and use the “Show Only Songs Not In iTunes” option. If I’m correctly interpreting how PodWorks queries iTunes, this should give you an accurrate representation of any files that are present on your iPod but missing from you iTunes library.

2 Responses to “iPod Sync Question”

  1. David Siebecker Says:

    I know that if you insert a file that has the exact same ID3 tags and length and so forth that iTunes will not reimport it. That much I can confirm. As for changing the settings without the iPod attached, I don’t know.

  2. Buzz Andersen Says:

    Glad to see that PodWorks helped. I hope the “Show Only Songs Not in iTunes” thing worked well for you–unfortunately I think it’s a bit too picky about matching sometimes (it’s case sensitive and requires a lot of the metadata between the song on the iPod and the song in iTunes to be the same before it’s considered a match). I’ve been working on changing that in the next version (if I can ever find time to finish that).