AtOM/lib/encode/vorbis
Vincent Riquer 387c88b9da releasecountry: attempt to write to destination
Limited support for MP3, ID3v2 is quite limited
2025-02-10 00:53:54 +01:00

50 lines
1.7 KiB
Bash

#!/bin/bash
encodeFile::vorbis() {
oggencopts=(${ionice}oggenc -Q -q ${destinationquality[$destination]})
[ -n "$albumartist" ] && oggencopts+=(-c "ALBUMARTIST=$albumartist")
[ -n "$album" ] && oggencopts+=(-l "$album")
[ -n "$artist" ] && oggencopts+=(-a "$artist")
[ -n "$composer" ] && oggencopts+=(-c "COMPOSER=$composer")
[ -n "$disc" ] && oggencopts+=(-c "DISCNUMBER=$disc")
[ -n "$genre" ] && oggencopts+=(-G "$genre")
[ -n "$performer" ] && oggencopts+=(-c "PERFORMER=$performer")
[ -n "$releasecountry" ] \
&& oggencopts+=(--comment "RELEASECOUNTRY=$releasecountry")
[ -n "$title" ] && oggencopts+=(-t "$title")
[ -n "$track" ] && oggencopts+=(-N "$track")
[ -n "$year" ] && oggencopts+=(-d "$year")
oggencopts+=(-o "$destdir/$destfile.ogg" "$tempdir/$tmpfile.wav")
encodetaskid=$(
Insert tasks <<-EOInsert
key ${fileid}oggenc$destination
requires ${soxtaskid:-$decodetaskid}
fileid $destfileid
filename $destdir/$destfile.ogg
$(
for key in ${!oggencopts[@]}
do
cleanedopts="${oggencopts[key]//\&/\\\&}"
cleanedopts="${cleanedopts//\[/\\[}"
cleanedopts="${cleanedopts//\]/\\]}"
cleanedopts="${cleanedopts//\{/\\{}"
cleanedopts="${cleanedopts//\}/\\\}}"
echo "cmd_arg$key ${oggencopts[key]}"
done
)
source_file $fileid
status 0
rename_pattern ${destinationrenamepath[$destination]}/${destinationrename[$destination]}
fat32compat ${destinationfat32compat["$destination"]}
ascii ${destinationascii["$destination"]}
EOInsert
)
parent_required=$(
Select tasks required_by \
<<<"id = ${soxtaskid:-$decodetaskid}"
)
Update tasks required_by $((++parent_required)) \
<<<"id = ${soxtaskid:-$decodetaskid}"
progressSpin
soxtaskid=''
}