Add id3-album.rb
This commit is contained in:
1 parent
3379b3c58b
commit
343d1277d6
1 file changed
+33
Executable
+33
@@ -0,0 +1,33 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
# Install: kid3-common
|
||||||
|
|
||||||
|
$stdout.sync = true
|
||||||
|
|
||||||
|
$stdout.write("Artist: ")
|
||||||
|
artist = gets.chomp
|
||||||
|
|
||||||
|
$stdout.write("Album: ")
|
||||||
|
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
|
||||||
|
command = %w[kid3-cli]
|
||||||
|
command += ["-c", %[set artist "#{artist}" 12]]
|
||||||
|
command += ["-c", %[set title "#{title}" 12]]
|
||||||
|
command += ["-c", %[set album "#{album}" 12]]
|
||||||
|
command += ["-c", %[set date "#{year}" 12]]
|
||||||
|
command += ["-c", %[set track "#{track_number}" 12]]
|
||||||
|
command += ["-c", %[set picture:albumart.jpg 'Front Cover' 2]]
|
||||||
|
command += ["-c", "save"]
|
||||||
|
command << file
|
||||||
|
system(*command)
|
||||||
|
else
|
||||||
|
$stderr.puts "Warning: skipping #{file}, unrecognized name format"
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in new issue
Block a user