Wednesday, August 22, 2007

Apple TV: Using Multiple Movie Libraries

My new Apple TV plays iTunes media files — movies, songs, etc. — on my HDTV via my wireless home network. In Apple TV: Getting Content I showed how to use BitTorrent to get movies to play on it.

I also mentioned ripping DVDs you own into iTunes-playable format using HandBrake. I covered that more fully in my Apple TV is a Winner! post as well as in earlier posts in my Ripping DVDs category.

My movie library is accordingly getting way big ... which means scrolling through all the titles on Apple TV can be a chore. I wondered whether I could split them up into two separate iTunes libraries.

Apple TV can sync to just one iTunes library, but it can stream from up to five separate iTunes libraries. They can be on separate computers. But two or more of them can well be on a single Mac.

iTunes has the ability to create and use more than one library, each with different contents. You can switch among them in iTunes' Preferences/Advanced/General pane. Or you can choose which library to use — or establish a new one — by holding down the Option key (Shift key on Windows) as you start iTunes. But any one invocation of iTunes can use just one library at a time. How can you have multiple iTunes open at once, each using a separate library which Apple TV can stream from?


The answer involves setting up a separate user account for each extra open iTunes you want. If you as administrator open System Preferences and click on Accounts, you can unlock that preferences panel by clicking on the lock icon and typing in your password. Then you can create a separate new account just for running another iTunes. It's a good idea to checkmark Fast User Switching under Login Options so you will be able to toggle back and forth between the new account and your main account by selecting items in a special menu that now appears at the right end of your menu bar.

Once you have the new account set up, toggle to it (entering its password when asked). Start up iTunes for the first time in it. In iTunes Preferences/Advanced/General, de-checkmark "Copy files to iTunes music folder when adding to library," since you don't want to create new copies of big movie files each time you import one of them into the (currently empty) library of this new user environment's iTunes.

Also, under Preferences/General, make sure you see the Shared Name you want to appear as a source on Apple TV. Since I created my alter-ego "user" as dalekhound — I'm a Doctor Who fan — the default Shared Name was "dalekhound Library," which I saw no need to change.

Now toggle back to the original user environment and move the folder(s) containing your iTunes movies from wherever it is (or they are) to the Shared folder. The Shared folder is in the ~/Users folder (where '~' represents your hard drive) right alongside one folder for each separate user account on your system. The contents of your Shared folder are available to all users.

Toggle back to the new user environment. Open the Shared folder in the finder. In it you will find all your movies (possibly nested in folders within Shared). Drag any or all of their icons into the new iTunes — it's still open, right? — or onto its icon in the dock. They'll quickly show up and be playable as movies within the new iTunes.

If you toggle back to the old user environment and its iTunes, you can still see the movies originally listed there, and they play just fine. iTunes lets you move movie files around on your hard drive without losing track of them.


So now you have two iTunes libraries in two separate user environments, both active at once!

You can tailor each one to your liking. For example, I removed all my TV episodes from one of my libraries — the original one — without telling iTunes to drag their files to the trash, mind you. From the other iTunes, I deleted everything except TV episodes. Or, to be precise, I simply failed to import anything other than TV episodes into it, when I populated it for the first time.

Once all that is set up as you wish, go to your Apple TV and navigate to Sources. With some finagling, I was able to use "Connect to New iTunes" and arrange for "dalekhound Library" to appear in the sources list, right next to the Shared Name of my original iTunes, which was "Eric Stewart's MacBook." Also in the sources list was (still) the Shared Name of the iTunes I run on completely different Mac, wherein I have all my song files.

Keep in mind that each time you use "Connect to New iTunes," Apple TV gives you a new five-digit passcode that you need specifically to type into the iTunes you want to connect to. In my case, I made sure the new iTunes user environment was the active one, and I selected "Bedroom Apple TV" from the Devices list along the left side of the iTunes window. I typed in the passcode ... and lo and behold, Apple TV immediately let me start streaming movies from "dalekhound Library"!

My original "Eric Stewart's MacBook" still worked as a source for streaming movies as well! And my other Mac's music library also remained available, just as it always had been. So I had three streaming sources, two of which were separate iTunes invocations running in separate user environments at one and the same time on a single Mac!

"What about syncing?" you may ask. It's no real problem. I already had my "Eric Stewart's MacBook" iTunes set up to sync to Apple TV. After all the shenanigans I just told you about, it was still set up to sync. And syncing still worked just fine ... just as it had always done.


I intend to add copiously to my movie library in the future. Each new movie file will be created in (or moved to) my Shared folder. I'll import it into whichever iTunes library I want it in in the customary way. I.e., I'll drag its icon into the iTunes window (or onto the iTunes icon in the Dock) of whichever user environment it "belongs" to.

Nor is there any reason why I cannot have a given movie shared by both environments. I can't think of a reason why I would want to do this, offhand. After all, my original object was to keep each list of movies short and sweet in Apple TV. Yet it's still a possibility, if I should ever want to take advantage of it.

Furthermore, if I wanted to, I could expand the above to up to five separate iTunes user environments — counting the one on my other Mac as one of them — each able to stream to Apple TV, with one of them the designated syncing source for the Apple TV as well.

No comments: