roadrunnertwice: Me looking up at the camera, wearing big headphones and a striped shirt. (Reversal!)
[personal profile] roadrunnertwice
Well, without the module working against me at every turn, that was actually incredibly easy.

#!/usr/bin/env ruby

require 'id3lib'

ARGV.each {|file|
song = ID3Lib::Tag.new(file)
song.remove_frame(:____) # <== This is actually a bug, or at least a really questionable feature, but it's totally working in my favor this time.
song.remove_frame(:TALB)
song.set_frame_text(:COMM, song.frame_text(:TIT3))
song.remove_frame(:TIT3)
song.update!
}


I don't have a good way to replace the album frame; it requires either a human reader or a smarter parser than I can write. So I just copy the description to the comments frame, where I can read it from within iTunes, and type in the album myself when and if the spirit moves me.
Depth: 1

Date: 2007-10-23 06:13 pm (UTC)
From: [identity profile] boopsce.livejournal.com
Writing code that relies on a bug or at least a really questionable feature: smooth! ;)