commit 9ab3412e7d286d9cece6839fd547cbfca7c0b354 Author: phantomjinx <p.g.richard...@phantomjinx.co.uk> Date: Thu Jan 13 21:06:28 2011 +0000
Fix logging in conversion scripts * convert-2mp4.sh * Move first log line as stupidly in the wrong place * convert-2m4a.sh * convert-2mp3.sh * Add logging to these scripts scripts/convert-2m4a.sh | 9 +++++++-- scripts/convert-2mp3.sh | 7 +++++-- scripts/convert-2mp4.sh | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) --- diff --git a/scripts/convert-2m4a.sh b/scripts/convert-2m4a.sh index c999bb8..6b132b3 100755 --- a/scripts/convert-2m4a.sh +++ b/scripts/convert-2m4a.sh @@ -29,10 +29,15 @@ ENCODER="faac" . ${0%/*}/gtkpod-convert-common.sh +LOG=`dirname "$outfile"` +LOG=${LOG%.log} + +echo "Attempting to convert file" >> $LOG + if [ $filetype = "wav" ]; then - "$encoder" -o "$outfile" $ENCODER_OPTS -w --artist "$artist" --title "$title" --year "$year" --album "$album" --track "$track" --genre "$genre" --comment "$comment" "$infile" + "$encoder" -o "$outfile" $ENCODER_OPTS -w --artist "$artist" --title "$title" --year "$year" --album "$album" --track "$track" --genre "$genre" --comment "$comment" "$infile" >> $LOG 2>&1 else - "$decoder" $options "$infile" | "$encoder" -o "$outfile" $ENCODER_OPTS -w --artist "$artist" --title "$title" --year "$year" --album "$album" --track "$track" --genre "$genre" --comment "$comment" - + "$decoder" $options "$infile" | "$encoder" -o "$outfile" $ENCODER_OPTS -w --artist "$artist" --title "$title" --year "$year" --album "$album" --track "$track" --genre "$genre" --comment "$comment" - >> $LOG 2>&1 fi # Check result if [ "x$?" != "x0" ]; then diff --git a/scripts/convert-2mp3.sh b/scripts/convert-2mp3.sh index ed35126..0bfc2c0 100755 --- a/scripts/convert-2mp3.sh +++ b/scripts/convert-2mp3.sh @@ -26,6 +26,9 @@ ENCODER="lame" . ${0%/*}/gtkpod-convert-common.sh +LOG=`dirname "$outfile"` +LOG=${LOG%.log} + # Check if the genre is one which lame supports if [ -n "$genre" ] && `"$encoder" --genre-list 2>&1 | cut -c 5- | grep -qi "^$genre$"`; then usegenre=$genre @@ -39,9 +42,9 @@ else fi if [ $filetype = "wav" ]; then - "$encoder" $ENCODER_OPTS --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$year" --tc "$comment" --tn "$track" --tg "$usegenre" "$infile" "$outfile" + "$encoder" $ENCODER_OPTS --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$year" --tc "$comment" --tn "$track" --tg "$usegenre" "$infile" "$outfile" >> $LOG 2>&1 else - "$decoder" $options "$infile" | "$encoder" $ENCODER_OPTS --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$year" --tc "$comment" --tn "$track" --tg "$usegenre" - "$outfile" + "$decoder" $options "$infile" | "$encoder" $ENCODER_OPTS --add-id3v2 --tt "$title" --ta "$artist" --tl "$album" --ty "$year" --tc "$comment" --tn "$track" --tg "$usegenre" - "$outfile" >> $LOG 2>&1 fi # Check result if [ "x$?" != "x0" ]; then diff --git a/scripts/convert-2mp4.sh b/scripts/convert-2mp4.sh index acfb803..97c4b83 100755 --- a/scripts/convert-2mp4.sh +++ b/scripts/convert-2mp4.sh @@ -24,13 +24,13 @@ extension="mp4" ENCODER_OPTS="-y -sameq -acodec aac -ab 160k -b 1100k -s 640x480 -aspect 4:3" ENCODER="ffmpeg" -echo "Attempting to convert file" >> $LOG - . ${0%/*}/gtkpod-convert-common.sh LOG=`dirname "$outfile"` LOG=${LOG%.log} +echo "Attempting to convert file" >> $LOG + "$encoder" -i "$infile" $ENCODER_OPTS -metadata author="$artist" -metadata title="$title" -metadata album="$album" -metadata year="$year" -metadata track="$track" -metadata genre="$genre" -metadata comment="$comment" "$outfile" >> $LOG 2>&1 # Check result ------------------------------------------------------------------------------ Protect Your Site and Customers from Malware Attacks Learn about various malware tactics and how to avoid them. Understand malware threats, the impact they can have on your business, and how you can protect your company and customers by using code signing. http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ gtkpod-cvs2 mailing list gtkpod-cvs2@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2