tc-audio-transcode: fixes.

master
Pierre Neidhardt 2013-04-21 15:16:49 +02:00
parent 085d1fa9d1
commit 719998eb16
2 changed files with 4 additions and 4 deletions

View File

@ -243,7 +243,7 @@ OUTPUT_ALBUM=$(eval _string_cleanser $OUTPUT_ALBUM)
## If it matches, we use the Title Case match. If it does not, we set it to
## empty.
if [ "$OUTPUT_GENRE" = '$GENRE' ]; then
GENRE=$(eval _string_cleanser $GENRE | tr '[:upper:] ' '[:lower:]_')
GENRE=$(_string_cleanser "$GENRE" | tr '[:upper:] ' '[:lower:]_')
case $GENRE in
ost) OUTPUT_GENRE="Soundtrack" ;;
soundtrack) OUTPUT_GENRE="Soundtrack";;
@ -258,7 +258,6 @@ else
OUTPUT_GENRE=$(eval _string_cleanser $OUTPUT_GENRE)
fi
## We remove the track count if any, we suppress leading zeros, we suppress all
## non-digit characters.
OUTPUT_TRACK=$(eval _string_cleanser $OUTPUT_TRACK | sed -e 's/^0*//' -e 's|[^[:digit:]].*||')

View File

@ -75,8 +75,9 @@ function titlecase(string) {
## will follow English punctuation rules.
b = gensub(/ +([,!:;?.]+) */, "\\1 ", "g", b)
## Compress spaces or tabs. Trim prefix and suffix space.
gsub(/[ \t]+/, " ", b)
## Compress spaces or tabs. Trim prefix and suffix space. Convert
## underscores to spaces.
gsub(/[_ \t]+/, " ", b)
gsub(/^ /, "", b)
gsub(/ $/, "", b)