[Abcde-users] Custom Command Output to Output DIR/Folder
Roger
rogerx.oss at gmail.com
Thu May 16 04:11:12 BST 2013
----- DIFF -----
--- /usr/bin/abcde.orig 2013-05-15 17:35:11.864693787 -0800
+++ /usr/bin/abcde 2013-05-15 17:55:36.270754854 -0800
@@ -1429,6 +1429,18 @@
fi
;;
esac
+
+ # Run post_move only once, while taking advantage of $OUTPUTFILEDIR variables.
+ #if [ $RAN_POST_MOVE -eq 0 ] || [ -z $RAN_POST_MOVE ]; then
+ if [ -z $RAN_POST_MOVE ]; then
+ echo "At line 1434:"
+ echo "OUTPUTDIR: "$OUTPUTDIR
+ echo "OUTPUTFILE: "$OUTPUTFILE
+ echo "OUTPUTFILEDIR= "$OUTPUTFILEDIR
+ cdrdao read-toc --fast-toc $OUTPUTFILEDIR/.cd.toc
+ RAN_POST_MOVE=1
+ fi
+
# Lets move the cue file
if CUEFILE=$(checkstatus cuefile) >/dev/null ; then
if [ -r "$ABCDETEMPDIR/$CUEFILE" ]; then
----- DIFF -----
Using the above snippet of code/script, I found out this do_move is traversed over one last time, and the last time even my read-only RAN_POST_MOVE variable is found null!
The likely reason why this do_move is tranversed over once last time after the CD is ejected, it's moving the encoded files.
This is also likely done to run more than one command at the same time.
The below debug output is evidence of this. (ie. #MAXPROCS=2 is commented in .abcde.conf.) You can see the CD has been ejected, and cdrdao is once again being called when it should not be as it was first ran after Track 01 and never again until after the CD was ejected.
--- Snip Debug ---
echo Tagging track 10 of 10: Walking Towards Paradise...
Tagging track 10 of 10: Walking Towards Paradise...
tagtrack-wav-10 true
tagtrack-ogg-10 nice -n 10 vorbiscomment -R -w /home/roger/tmp/abcde.880b080a/track10.uncommented.ogg /home/roger/tmp/abcde.880b080a/track10.ogg
tagtrack-10 true
movetrack-10 mv /home/roger/tmp/abcde.880b080a/track10.wav /home/roger/Music-New/Robert_Plant/Now_And_Zen/10.Walking_Towards_Paradise.wav
Cdrdao version 1.2.3 - (C) Andreas Mueller <andreas at daneb.de>
/dev/sr0: HL-DT-ST BD-RE WH14NS40 Rev: 1.00
Using driver: Generic SCSI-3/MMC - Version 2.0 (options 0x0000)
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
WARNING: Unit not ready, still trying...
ERROR: Unit not ready, giving up.
ERROR: Cannot setup device /dev/sr0.
movetrack-10 mv /home/roger/tmp/abcde.880b080a/track10.ogg /home/roger/Music-New/Robert_Plant/Now_And_Zen/10.Walking_Towards_Paradise.ogg
[WARNING] The encoded formats does not match with the moved ones
[WARNING] Formats encoded: ogg
[WARNING] Formats moved: ogg wav
[WARNING] Use "abcde -a clean -f -C 880b080a" to force the removal of the remaining data.
Finished. Not cleaning /home/roger/tmp/abcde.880b080a.
--- Snip Debug ---
The begin of do_move has some filename munging, which might be moved into it's own function and maybe called from a post_move function.
But my patience is running low as this script is doing two things at once, reading the CD and encoding.
>From my experience, wiping a read-only variable should not be happening.
Might only be able to make useful post_ & pre_ functions with used inline variables only after a rewrite. :-/
--
Roger
http://rogerx.freeshell.org/
More information about the Abcde-users
mailing list