Package: abcde
Version: 2.3.99.2-1
1. For ogg Vorbis files, the extension in OUTPUTPATH can be wrong.
To fix that I changed $OUTPUT to $OUTPUTCONTAINER in a couple of
places. I suspect something similar will be necessary for
do_playlist().
2. the GENRE and YEAR variables are not set in function
do_replaygain(), so $OUTPUTFILE gets an incomplete path, causing files
not to be found.
3. Line 1247 seems to do nothing more than setting $YEAR to the value
of $CDYEAR, whether it is filled or not (the default value is $CDYEAR
itself). I didn't modify it, since I don't know exactly what would go
there.
4. It looks like the code for munging CDDB fields, etc, and
creating filenames is repeated quite a few times times through the
script, with slight variations. Seems like a good candidate for
refactoring.
Thanks for such a great program! About a month ago I started ripping
my CD collection, and I tried quite a few rippers/encoders/taggers.
None did all I wanted, although Grip came close. I wrote a couple of
Perl scripts to hook to Grip, so I could do multiencoding, proper
munging of tags, and automatic addition of replay gain tags. But it
turned out Grip can't call a script after enconding, only after
ripping, so no replaygain. When I was almost convinced I'd have to
write my own and even had started planning what I'd code and what
modules to use, I tried abcde and discovered it did everything I
needed, and then some.
Anyway, here is a patch with the above changes (first time I submit a
patch, so be forgiving; I used diff -Naur, as the man page for patch
recommends):
--- ../../install/abcde/abcde-2.3.99.2/abcde 2005-12-12
17:06:59.000000000 -0500
+++ abcde 2006-01-25 23:36:20.772283517 -0500
@@ -363,15 +363,15 @@
do_replaygain()
{
if checkstatus replaygain; then :; else
- run_command "" echo "Adding replygain information..."
+ run_command "" echo "Adding replaygain information..."
for OUTPUT in $( echo $OUTPUTTYPE | tr , \ )
do
case $OUTPUT in
vorbis|ogg)
- OUTPUT=$OGGOUTPUTCONTAINER
+ OUTPUTCONTAINER=$OGGOUTPUTCONTAINER
;;
flac)
- OUTPUT=$FLACOUTPUTCONTAINER
+ OUTPUTCONTAINER=$FLACOUTPUTCONTAINER
;;
esac
OUTPUTFILES=""
@@ -384,13 +384,15 @@
TRACKFILE="$(mungefilename "$TRACKNAME")"
ARTISTFILE="$(mungefilename "$TRACKARTIST")"
ALBUMFILE="$(mungefilename "$DALBUM")"
+ GENRE="$(mungegenre "$GENRE")"
+ YEAR="$(echo $CDYEAR)"
do_gettracknum
if [ "$VARIOUSARTISTS" = "y" ]; then
OUTPUTFILE="$(eval echo
$VAOUTPUTFORMAT)"
else
OUTPUTFILE="$(eval echo $OUTPUTFORMAT)"
fi
-
OUTPUTFILES[$REPLAYINDEX]="$OUTPUTDIR/$OUTPUTFILE.$OUTPUT"
+
OUTPUTFILES[$REPLAYINDEX]="$OUTPUTDIR/$OUTPUTFILE.$OUTPUTCONTAINER"
(( REPLAYINDEX = $REPLAYINDEX + 1 ))
done
case "$OUTPUT" in
@@ -1144,7 +1146,7 @@
# TRACKNUM value before evaluation
do_gettracknum
# Supported variables for OUTPUTFORMAT are GENRE,
ALBUMFILE, ARTISTFILE,
- # TRACKFILE, and TRACKNUM.
+ # TRACKFILE, TRACKNUM, YEAR and ALBUMFILE.
if [ "$VARIOUSARTISTS" = "y" ]; then
OUTPUTFILE="$(eval echo "$VAOUTPUTFORMAT")"
else
Thanks again.
Bernardo Rechea