#! /usr/bin/env ruby # # mp3txt - list mp3 files. # # Copyright (C) 2000 Satoru Takabayashi # All rights reserved. # This is free software with ABSOLUTELY NO WARRANTY. # # You can redistribute it and/or modify it under the terms of # the Ruby's licence. # require 'id3v1' # class ID3v1 attr_reader :path end ARGV.map {|path| ID3v1.new(path) }.sort {|a, b| (a["Artist"] <=> b["Artist"]).nonzero? || (a["Album"] <=> b["Album"]).nonzero? || (a["Title"] <=> b["Title"]).nonzero? || (a.path <=> b.path).nonzero? }.each {|id| printf "%s / %s / %s\n", id["Artist"], id["Album"], id["Title"] }