Having a Mac and a lot of DVDs, I happen to be quite fond of Handbrake. However, how is one supposed to organize all of this video within iTunes for inevitable use on an AppleTV, I ask you?
Videos imported into iTunes 7 automatically register as “Movies”. So how do you handle TVShows? By changing/adding metadata to each of the populated fields on these screens:
That’s a whole lot of metadata! Sure, you can update all of the metadata by hand but, really, who has the time?
So I wrote some code.
With RubyOSA, the world of AppleScript is now available to Ruby developers — without the trama of learning AppleScript!
If you can understand the code below, you should be able to figure out how to tweak it ever so slightly as necessary to have it manipulate your media of choice.
require 'rubygems' require 'rbosa'$show = “Babylon 5″ $year = 1994 $itunessearchstr = “B5″
app = OSA.app(’iTunes’) exit unless not app.nil?
movies = app.sources[0].playlists.find { |p| p.name == “Movies” }
tracks = movies.search $itunessearchstr
tracks.each do |track|
puts track.name
track.name.match /B5\s-\s(\d+)\s(.*)/
track.name = $2
track.tracknumber = $1.toi
track.artist = $show
track.album_artist = $show
track.album = $show
track.show = $show
track.episodeid = $1.toi
track.episodenumber = $1.toi
track.year = $year
track.season_number = 1
track.videokind = OSA::ITunes::EVDK::TVSHOW
end





0 comments ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment