From 272e295b742b923230dd14a4f24938209af28d37 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Fri, 2 Nov 2007 17:25:03 +0000 Subject: [PATCH] scheint jetzt wirklich gut zu funktionieren...zumindest mit flac. Hab nahezu alle meine CDs damit encoded. Was anderes als flac hab ich noch nicht getestet. --- getcd.sh | 28 ++++++++++++++-------------- shellUtils.sh | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/getcd.sh b/getcd.sh index 172555b..dd47d71 100755 --- a/getcd.sh +++ b/getcd.sh @@ -412,7 +412,7 @@ do case ${encodingType} in f) outFile="`printf %02d ${trackNr}`-${tTitle[$i]}.flac" - outStr="track-$trackNr => ${outFile}: " + outStr="track-$trackNr => ${outFile/\//-}: " ( exec 2>&1 @@ -422,14 +422,14 @@ do -T genre="${dGenre}" -T title="${tTitle[$i]}" \ -T tracknumber="${trackNr}" -T tracknum="${trackNr}" \ -T date="${dYear}" -T comment="" \ - -o "${encodingDir}/${outFile}" - #2>/dev/null + -o "${encodingDir}/${outFile/\//-}" - #2>/dev/null ) | tr '\r' '\n' |\ - sed '/^ [0-9]/!d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ + sed '/^ [0-9]/!d;/^ *[0-9]*\./d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ tr -d '\n' >$outStream ;; m) outFile="`printf %02d ${trackNr}`-${tTitle[$i]}.mp3" - outStr="track-$trackNr => ${outFile}: " + outStr="track-$trackNr => ${outFile/\//-}: " case ${encoder} in lame) @@ -441,9 +441,9 @@ do --tg "${dGenre}" --tt "${tTitle[$i]}" \ --tn "${trackNr}" --ty "${dYear}" \ --tc "" \ - - "${encodingDir}/${outFile}" 2>/dev/null + - "${encodingDir}/${outFile/\//-}" 2>/dev/null ) | tr '\r' '\n' |\ - sed '/^ [0-9]/!d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ + sed '/^ [0-9]/!d;/^ *[0-9]*\./d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ tr -d '\n' >$outStream ;; bladeenc) @@ -451,16 +451,16 @@ do exec 2>&1 cdda2wav -H -D/dev/cdrom -I${cddaIf} -t${trackNr} - |\ bladeenc -progress=0 STDIN \ - "${encodingDir}/${outFile}" 2>/dev/null + "${encodingDir}/${outFile/\//-}" 2>/dev/null ) | tr '\r' '\n' |\ - sed '/^ [0-9]/!d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ + sed '/^ [0-9]/!d;/^ *[0-9]*\./d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ tr -d '\n' >$outStream ;; esac ;; o) outFile="`printf %02d ${trackNr}`-${tTitle[$i]}.ogg" - outStr="track-$trackNr => ${outFile}: " + outStr="track-$trackNr => ${outFile/\//-}: " ( exec 2>&1 @@ -469,21 +469,21 @@ do -G "${dGenre}" -t "${tTitle[$i]}" \ -N "${trackNr}" -d "${dYear}" \ -c "" \ - -o "${encodingDir}/${outFile}" - 2>/dev/null + -o "${encodingDir}/${outFile/\//-}" - 2>/dev/null ) | tr '\r' '\n' |\ - sed '/^ [0-9]/!d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ + sed '/^ [0-9]/!d;/^ *[0-9]*\./d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ tr -d '\n' >$outStream ;; w) outFile="`printf %02d ${trackNr}`-${tTitle[$i]}.wav" - outStr="track-$trackNr => ${outFile}: " + outStr="track-$trackNr => ${outFile/\//-}: " ( exec 2>&1 cdda2wav -H -D/dev/cdrom -I${cddaIf} -t${trackNr} - >\ - "${encodingDir}/${outFile}" + "${encodingDir}/${outFile/\//-}" ) | tr '\r' '\n' |\ - sed '/^ [0-9]/!d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ + sed '/^ [0-9]/!d;/^ *[0-9]*\./d;s/^.* \([0-9]*%\).*$/\r'"${outStr}"'\1/' |\ tr -d '\n' >$outStream ;; esac diff --git a/shellUtils.sh b/shellUtils.sh index 09086eb..2324885 100644 --- a/shellUtils.sh +++ b/shellUtils.sh @@ -464,7 +464,7 @@ function getCDInfo if [ "x$delimiter" != "x" ] then eval "`echo "$cddb" | tr -d '\r' | sed ' - /TTITLE/s/^TTITLE\([0-9]*\)=\(\(.*\)'"$delimiter"'\)*\(.*\)$/tArtist[\1]="\3";tTitle[\1]="\4"/p + /TTITLE/s/^TTITLE\([0-9]*\)=\(\(.*\)'"${delimiter/\//\\/}"'\)*\(.*\)$/tArtist[\1]="\3";tTitle[\1]="\4"/p d'`" fi fi