Sha256: 2fd5b2b78e9827cc912ebcdb051f4149084d4b0fb0edd358f665ddab16acfd2b
Contents?: true
Size: 931 Bytes
Versions: 8
Compression:
Stored size: 931 Bytes
Contents
#!/usr/bin/ruby require 'mp3tag' def getList(dir) Dir::chdir(dir) # Find the files in this directory Dir['*mp3'].each { |file| if(FileTest::file?(file)) mp3tag = Mp3Tag::new(Dir::getwd()+"/"+file) if(mp3tag.songname.length > 0) puts("#{Dir::getwd()+"/"+file}||#{mp3tag.songname}||#{mp3tag.artist}||#{mp3tag.album}||#{mp3tag.year}||#{mp3tag.comment}||#{mp3tag.tracknum}||#{mp3tag.genre_id}||#{mp3tag.genre}") else name = Dir::getwd()+"/"+file name =~ /([^\/]+)\.mp3$/ puts("#{Dir::getwd()+"/"+file}||#{$1}||#{mp3tag.artist}||#{mp3tag.album}||#{mp3tag.year}||#{mp3tag.comment}||#{mp3tag.tracknum}||#{mp3tag.genre_id}||#{mp3tag.genre}") end end } Dir['*'].each { |entry| if(FileTest::directory?(entry)) getList(entry) end } Dir::chdir('..') end # Change current directory to user supplied one Dir::chdir(ARGV[0]) getList(ARGV[0]) #song = Mp3Tag::new(ARGV[0]) #puts song.songname()
Version data entries
8 entries across 8 versions & 4 rubygems