albumsetup: fix

This commit is contained in:
yosh 2023-09-30 21:14:38 -04:00
parent 26ef00ef75
commit 94352621a9
1 changed files with 4 additions and 2 deletions

View File

@ -39,6 +39,7 @@ grab_info() {
ARTIST="$(grab_tag "$1" ARTIST)"
ALBUM="$(grab_tag "$1" ALBUM)"
TITLE="$(grab_tag "$1" TITLE)"
ALBUMARTIST="$(grab_tag "$1" ALBUMARTIST)"
TRACKNUMBER="$(printf '%03g' "$(grab_tag "$1" TRACKNUMBER)")"
set -e
}
@ -72,7 +73,7 @@ extract_cover() {
set -e
# resize within the bounds of 1280x720
# if it's square then make it 722x720 so youtube doesn't make it a short
[ -f "$2" ] && magick mogrify -resize 1280x720 -background black -gravity center -extent 722x720 "$2"
[ -f "$2" ] && magick mogrify -resize 1280x720 -background black -gravity center -extent 722x720 "$2" || true
}
# sets COVER_PIC for use in convert_vid
@ -161,6 +162,7 @@ else
# sort by correct track numbers then remove track numbers later
sort -o "$OUTDIR/metadata.txt.sorted" "$OUTDIR/metadata.txt"
sort -o "$OUTDIR/ffmpeg_tracklist.txt" "$OUTDIR/ffmpeg_tracklist.txt"
while read -r track name; do
printf '%s\n' "$name"
done <"$OUTDIR/metadata.txt.sorted" >"$OUTDIR/metadata.txt"
@ -168,7 +170,7 @@ else
if [ -z "$NO_CONVERT" ]; then
errecho "Building full video..."
ffmpeg -safe 0 -f concat -i "$OUTDIR/ffmpeg_tracklist.txt" -c copy "$OUTDIR/$ARTIST - $ALBUM.webm"
ffmpeg -safe 0 -f concat -i "$OUTDIR/ffmpeg_tracklist.txt" -c copy "$OUTDIR/$ALBUMARTIST - $ALBUM.webm"
fi
rm "$OUTDIR/ffmpeg_tracklist.txt"