April 13, 2004
iTunes: Trick for Making "Local Only" Playlist
Posted by Larry Karnowski at April 13, 2004 11:02 AMThere are a few of us at work that are using music sharing through iTunes (which rocks!). However, there's a problem with it. My iTunes library on my laptop still has thousands of songs from my mp3 server at home, which are of course inaccessible when I'm at work. I've really only got about a dozen albums actually on my iBook hard drive at any one time. So I've got folks complaining that when they're looking through my iTunes shared music list, they can't find what's actually there to listen to for all the missing tracks. What to do?
Well, I knew I could create a playlist with only the local songs and then tell iTunes only to share that playlist, but I didn't know how to create that playlist. My first thought was a smart playlist (one of the coolest iTunes features IMHO), but you can't create a smart playlist based on where a file lives, sadly enough. Then I thought about going through and adding the local files manually, but screw that. I don't have a CS degree for nuthin', so instead I was thinking of writing an Applescript to make iTunes do my work. However, then I had a stroke of luck -- I remembered a strange behavior that I could exploit to make this work.
Here's what you do: First, make sure you don't have your MP3 server mounted. I also recommend stopping and then restarting iTunes to clear any caches. Then go to the library, make sure all the songs are displayed, and hit splat-A to select all the songs. (The "splat" key is also variously called the "command" key or the "Apple" key. On Windoze you use control-A instead.)
Now, don't do the cool thing of holding shift and hitting the + button to create a new playlist for your selected songs. This is indeed cool, but it will include songs that aren't local to your machine. Instead, drag all those selected songs over into the "source" side window where your playlists are. You'll get a busy cursor for a little bit while it tries to read all those files. My almost five-thousand library took less than a minute though.
What's happening is that iTunes is going through each song trying to find the song file. If it finds the file, it puts it into the playlist. If it can't, however, that song is ignored! I always thought this was odd behavior for the dragging action to take, and I still kinda think it's odd, but in this situation it really helps. When it's done, you're left only with all the "local" files -- files that are immediately accessible to iTunes -- in your playlist. That most likely means only the files that are on your local hard-drive.
A couple of cleanup tasks -- be sure to remove all the radio stations you might have on your library, as they'll be in your playlist. No one wants to play a radio station through a shared iTunes connection. Also, any protected AAC files you downloaded from the iTMS will be in the playlist too, but your friends can't listen to those over a share unless they have your password. (Which you probably don't want to do, as you can only have so many computers at one time use that password.) So be sure to remove those too.
The best way to find the AAC files you want to remove is to click on the playlist, then click on the Edit/View Options menu. Add the "Kind" field to your view options, and hit okay. Now you can go to your playlist and sort by kind. Anything marked "Protected AAC" file should be removed from your playlist.
Now go to the iTunes/Preferences menu, hit the Sharing tab, and choose "Share selected playlists." You'll have to scroll down and select the local playlist (and in this case, ONLY the local playlist), and voila, iTunes will only advertise songs that people will really be able to hear.
Hmm, this would still be a great iTunes Applescript. I might write it one day if I do this often enough. Also, if anyone decides to write it, please send me a copy! It should scan the library for files in the local music library, exclude radio stations, exclude protected AAC files, and then create a playlist for everything that's left over.
Huh?
Posted by: Frank at April 13, 2004 5:15 PMYou and me both, Frank. It's like when my dad and my brother start talking about carburetors (I can't even spell it) and intake valves and such. I nod and smile and say "uh-huh" a lot.
Posted by: Amy at April 13, 2004 7:53 PM
