Created
October 24, 2010 08:53
-
-
Save lucaspiller/643342 to your computer and use it in GitHub Desktop.
Set ID3 tags from filename
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'id3lib' | |
file=ARGV.join | |
filename=File.basename(file, '.mp3') | |
parts = filename.split('-') | |
artist = parts[1].strip | |
title = parts[2].strip | |
puts artist + " - " + title | |
track = ID3Lib::Tag.new(file) | |
track.title = title | |
track.artist = artist | |
track.update! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment