Programming is a wonderful mix of art and science; source code is both a poem and a math problem. It should be as simple and elegant as it is functional and fast. This blog is about that (along with whatever else I feel like writing about).

Monday, January 15, 2007

Getting iTunes to Recognize Your TV Shows

I have quite a few movies on my computer, as I've mentioned in previous articles. I've encoded most of them in H.264, which I find gives the best quality. Since I never felt like looking up my Quicktime 7 key (which I legally purchased when it came out, hoping it would allow me to encode DVDs more easily), I always played all my videos using VLC (because Quicktime doesn't let you do full screen). The process was annoying: I had to find the movie in the Finder, then drag it down to the VLC icon in the dock, then go to full screen. And VLC doesn't have an onscreen controller during full screen playback (at least not on Mac, I don't know about the status of other operating systems).

Needless to say, I started to find this pretty cumbersome. When iTunes first got the ability to play video, I jumped at the chance to have a program manage my video playing needs. I was grossly disappointed by how slow it was, and after a few hours of trying to set it up, went back to my Finder-VLC approach. Well, it's been a few iTunes updates since then, so I decided to give it another go.

The first thing you need to make sure you do is to set iTunes so it doesn't automatically move your files into the iTunes directory. This won't work at all when your main drive is full and most of your movies are on an external hard drive. Plus, it takes a really long time to transfer those files.

Adding the movies is very simple. Switch to the Movies tab on iTunes, then select all your movies, and drag them on over to iTunes. It'll chug for a little while, then give you a list of all your movies. You can set it to automatically play them full screen, which I like, and they give you a nice onscreen controller during full screen playback, which I like more.

But in addition to my movies, I also have quite a few television shows on this thing. And while iTunes does support TV shows, they seem to prefer that you buy them from the iTS rather than play your own. But I don't feel like repurchasing all these shows from Apple, so I need to get iTunes to recognize that they are, in fact, TV shows instead of Movies.

For an individual episode, this isn't too bad. You go to Get Info, then Video (a tab on top). Here you can set it to TV Show, and also enter the name of the show and the season number. Cool.

But that's really cumbersome if you have a lot of TV shows. You know, like a season. Or ten. Or, in my case, many many more. There MUST be a better way!

Doug's Applescripts give us Set Video Kind of Selected, which allows you to do this very thing to an arbitrary number of files. Awesome. Just download it, toss the Applescript file into /Users//Library/iTunes/Scripts, restart iTunes, and you're ready to get started.

Select your files:

When you drag them to iTunes, remember to select them all again and choose the script from the Applescript menu:

This will bring up a little dialog box where you can change the Video Kind to TV Show, the Show Name to, for example, "The Simpsons" and the Season Number to, say, 6.

It chugs for a few seconds, and then it says it's done. Popping over to the TV Shows tab in iTunes shows us that it did in fact work nicely, turning 5 or so minutes of tedious data entry into just a handful of seconds of just telling your computer what you want.

And the TV Show interface is kind of slick. Maybe it's possible for it to be a bit nicer or more usable, but come on ... it's easily a dozen times better than Finder+VLC. And iTunes certainly isn't as slow as it used to be.

And now I'm off to watch a bit of television. In iTunes. Tally ho!

No comments: