tag-mp3s: replace title and images
This commit is contained in:
parent
d3b5d86bca
commit
40fb9f1817
11
tag-mp3s
11
tag-mp3s
@ -9,11 +9,11 @@ def process_mp3(mp3_path)
|
|||||||
dirname = File.dirname(mp3_path)
|
dirname = File.dirname(mp3_path)
|
||||||
current_info, stderr, status = Open3.capture3("id3info", mp3_path)
|
current_info, stderr, status = Open3.capture3("id3info", mp3_path)
|
||||||
current_info.force_encoding("ASCII-8BIT")
|
current_info.force_encoding("ASCII-8BIT")
|
||||||
if current_info =~ /TIT2\s.*: (.*)/
|
#if current_info =~ /TIT2\s.*: (.*)/
|
||||||
title = $1
|
# title = $1
|
||||||
else
|
#else
|
||||||
title = File.basename(mp3_path).sub(/\.mp3$/, "")
|
title = File.basename(mp3_path).sub(/\.mp3$/, "")
|
||||||
end
|
#end
|
||||||
artist = File.basename(File.dirname(File.dirname(mp3_path)))
|
artist = File.basename(File.dirname(File.dirname(mp3_path)))
|
||||||
album = File.basename(File.dirname(mp3_path))
|
album = File.basename(File.dirname(mp3_path))
|
||||||
if current_info =~ /TYER\s.*: (.*)/
|
if current_info =~ /TYER\s.*: (.*)/
|
||||||
@ -33,8 +33,9 @@ def process_mp3(mp3_path)
|
|||||||
args += %W[--track=#{track_number}] if track_number
|
args += %W[--track=#{track_number}] if track_number
|
||||||
args += %W[--release-year=#{year}] if year
|
args += %W[--release-year=#{year}] if year
|
||||||
# 2017 Outback likes to show picture for OTHER but not FRONT_COVER...
|
# 2017 Outback likes to show picture for OTHER but not FRONT_COVER...
|
||||||
args += %W[--add-image=#{album_art}:OTHER] if album_art
|
#args += %W[--add-image=#{album_art}:OTHER] if album_art
|
||||||
args += [mp3_path]
|
args += [mp3_path]
|
||||||
|
system("eyeD3", "--remove-all", mp3_path)
|
||||||
system("eyeD3", *args)
|
system("eyeD3", *args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user