fix trailing whitespace in vorbis comments

This commit is contained in:
Lorenzo Pistone 2019-02-19 13:00:36 +01:00
parent 6d11933999
commit f7b0e2f17d
1 changed files with 9 additions and 8 deletions

17
tag_ogg
View File

@ -1,19 +1,20 @@
#!/bin/sh
#!/bin/bash
set -e
fname=$(echo "${4} - ${2}.ogg" | tr '/' -)
cat > "$fname"
echo "$fname"
fname="${4} - ${2}.ogg"
fname="${fname//\//-}"
cat > "${fname}"
echo "${fname}"
{
echo "SPOTIFY_ID=${1}"
title=$(tr '\n' ' ' <<< "${2}")
album=$(tr '\n' ' ' <<< "${3}")
title="${2//'\n'/' '}"
album="${3//'\n'/' '}"
echo "TITLE=${title}"
echo "ALBUM=${album}"
shift 3
for artist in "$@"; do
artist=$(tr '\n' ' ' <<< "${artist}")
artist="${artist//'\n'/' '}"
echo "ARTIST=${artist}"
done
} | vorbiscomment -a "$fname"
} | vorbiscomment -a "${fname}"