Archive for the 'The geek' Category

Geeking with the iPod 3G

I love my iPod, but I hate it too – I hates it for real. I can’t tell you the number of times I’ve formatted, restored and reconfigured it just to try to get it to behave. But a fully functioning iPod is very nice gadget to have around.

It’s a 3G iPod – third generation – so it’s got a lot of storage space (30 gigs), but from Apple’s point of view it’s a legacy product and not worth supporting. As such we 3G users are not getting any love. We paid the premium but now we’re left out in the desert, watching the 5G nanos leave their glamorous contrails overhead. This is progress.

Lest this post slide sideways into a rant, let me explain just a single problem I’m having here:

I recently added two Christmas CDs to the IPod. Now when I scroll through the artist list, I see Bing Crosby, Perry Como, even Garry Glitter – with only one track available under each artist. I consider this pollution. I don’t want to have to scroll through the chaff. The only time I ever play these songs is when I play the compilation. I need a ‘hide artists that are part of a compilation’ feature.

Although iTunes itself does offer this feature, sadly, my 3rd-generation IPod does not. I am on the latest software and firmware. I have flashed my BIOS and re-initialized my HKU’s. But the ‘compilation’ option is not to be found.

So it seemed to me that I could either use iTunes’ bulk-rename feature, or just delete the compilations entirely. I wasn’t about to do the latter – I have a dozen other compilations which I want to keep. And the former would leave me without any artist information at all.

So I got all geeked out and wrote a little script to fix it for me. The script renames the artist to ‘Christmas Compilation’, for example, and then renames each track to include both the track name and the artist: ‘Bing Crosby – White Christmas’.

The search function in iTunes isn’t affected, as it searches all metadata anyways. So typing ‘Bing’ will still find me the track if for some reason I’m desperate for it.

The script didn’t take long to write (certainly faster than doing it manually for each song on an album), and the result is now a usable iPod. I’m happy. I’m now considering doing something similar for all the singles I have in my collection, as I’m always after an existing playlist or an entire album. Singles be gone.

Ideally I’d like iTunes and the iPod to suck much less than they do. Tags. iPod folders. Allow the autonomy. I am the user.

Just in case you want to geek out with me, I’ve included the relevant c# code below. You can script against iTunes with any COM-compliant language. Just add a reference to iTunes.exe.

Caveat: this makes irreversible changes to your ITunes library! Back it up first.

private void FixCompilation()
{
string albumName = “Christmas Album”;
string newArtistName = “Christmas Compilation 1″;

// get a reference to the objects we need
iTunesLib.iTunesApp app = new iTunesLib.iTunesApp();
iTunesLib.IITSource source = app.LibrarySource;
iTunesLib.IITPlaylist mainPlayList = app.LibraryPlaylist;

// find the tracks
iTunesLib.IITTrackCollection foundTracks =
mainPlayList.Search(albumName,
iTunesLib.ITPlaylistSearchField.ITPlaylistSearchFieldAlbums);

// loop and rename
foreach (iTunesLib.IITTrack track in foundTracks)
{
string newTrackName = track.Artist + ” – ” + track.Name;
track.Name = newTrackName;
track.Artist = newArtistName;
track.Compilation = true;
}

// done.
MessageBox.Show(foundTracks.Count + ” titles changed.”);

}

(My apologies for the formatting. WordPress is such a pain at times).

Just leave a comment if you have any questions about the script.


Pages

Categories