id3-album.rb: read metadata from info.txt

This commit is contained in:
josh committed 2026-10-30 10:59:43 -04:00
1 parent 6d97a84bf9
commit aa73c356f5
1 file changed
+16 -6
+16 -6
View File
@@ -17,14 +17,24 @@ unless File.exist?("albumart.jpg")
exit 1
end
$stdout.write("Artist: ")
artist = gets.chomp
unless File.exist?("info.txt")
$stderr.puts "info.txt not found"
exit 1
end
$stdout.write("Album: ")
album = gets.chomp
info = File.read("info.txt")
info =~ /^artist: (.*)$/
artist = $1
info =~ /^album: (.*)$/
album = $1
info =~ /^year: (.*)$/
date = $1
unless artist && album && date
$stderr.puts "invalid info.txt format"
exit 1
end
$stdout.write("Release year: ")
date = gets.chomp
#$stdout.write("Release date (YYYY-MM-DD): ")
#date = gets.chomp
#unless date =~ /^\d{4}-\d{2}-\d{2}$/