diff --git a/id3-album.rb b/id3-album.rb index baa5aba..f535b2d 100755 --- a/id3-album.rb +++ b/id3-album.rb @@ -3,6 +3,12 @@ # Install: kid3-common $stdout.sync = true +files = Dir.glob("*.mp3").sort + +if files.empty? + $stderr.puts "No .mp3 files found" + exit 1 +end $stdout.write("Artist: ") artist = gets.chomp @@ -13,7 +19,6 @@ album = gets.chomp $stdout.write("Year: ") year = gets.chomp -files = Dir.glob("*.mp3").sort files.each do |file| if file =~ /^(\d+)\s*(.*)\.mp3$/ track_number, title = $1.to_i, $2