Changed non-action functions do_* to not use the do_ prefix.
# Finds an specific field from cddbinfo
# Finds an specific field from cddbinfo
# Get the track number we are going to use for different actions
# Get the track number we are going to use for different actions
{
if [ -n "$STARTTRACKNUMBER" ] ; then
# Get the trackpadding from the current track
{
if [ -n "$STARTTRACKNUMBER" ] ; then
# Get the trackpadding from the current track
for UTRACKNUM in $TRACKQUEUE
do
CDDBTRACKNUM=$(expr $UTRACKNUM - 1)
for UTRACKNUM in $TRACKQUEUE
do
CDDBTRACKNUM=$(expr $UTRACKNUM - 1)
- do_getcddbinfo TRACKNAME
splitvarious
TRACKFILE="$(mungefilename "$TRACKNAME")"
ARTISTFILE="$(mungefilename "$TRACKARTIST")"
ALBUMFILE="$(mungefilename "$DALBUM")"
splitvarious
TRACKFILE="$(mungefilename "$TRACKNAME")"
ARTISTFILE="$(mungefilename "$TRACKARTIST")"
ALBUMFILE="$(mungefilename "$DALBUM")"
if [ "$VARIOUSARTISTS" = "y" ]; then
if [ "$VARIOUSARTISTS" = "y" ]; then
- OUTPUTFILE="$(eval echo $VAOUTPUTFORMAT)"
+ OUTPUTFILE="$(eval echo "$VAOUTPUTFORMAT")"
- OUTPUTFILE="$(eval echo $OUTPUTFORMAT)"
+ OUTPUTFILE="$(eval echo "$OUTPUTFORMAT")"
fi
OUTPUTFILES[$REPLAYINDEX]="$OUTPUTDIR/$OUTPUTFILE.$OUTPUT"
(( REPLAYINDEX = $REPLAYINDEX + 1 ))
fi
OUTPUTFILES[$REPLAYINDEX]="$OUTPUTDIR/$OUTPUTFILE.$OUTPUT"
(( REPLAYINDEX = $REPLAYINDEX + 1 ))
# If we want to start the tracks with a given number, we need to modify the
# TRACKNUM value before evaluation
if [ -n "$STARTTRACKNUMBERTAG" ] ; then
# If we want to start the tracks with a given number, we need to modify the
# TRACKNUM value before evaluation
if [ -n "$STARTTRACKNUMBERTAG" ] ; then
fi
for OUTPUT in $(echo $OUTPUTTYPE | tr , \ )
do
fi
for OUTPUT in $(echo $OUTPUTTYPE | tr , \ )
do
# TRACKNUM, TRACKNAME, TRACKARTIST, DALBUM, OUTPUTFORMAT, CDGENRE, CDYEAR
do_move ()
{
# TRACKNUM, TRACKNAME, TRACKARTIST, DALBUM, OUTPUTFORMAT, CDGENRE, CDYEAR
do_move ()
{
- for OUTPUT in $(echo $OUTPUTTYPE | tr , \ )
+ for TMPOUTPUT in $(echo $OUTPUTTYPE | tr , \ )
+ # For now, set OUTPUT as TMPOUTPUT, and then change it once we have
+ # defined the OUTPUTFILE:
+ OUTPUT="$TMPOUTPUT"
+
# Create ALBUMFILE, ARTISTFILE, TRACKFILE
# Munge filenames as follows:
# ' ' -> '_'
# Create ALBUMFILE, ARTISTFILE, TRACKFILE
# Munge filenames as follows:
# ' ' -> '_'
ARTISTFILE="$(mungefilename "$TRACKARTIST")"
TRACKFILE="$(mungefilename "$TRACKNAME")"
GENRE="$(mungegenre "$GENRE")"
ARTISTFILE="$(mungefilename "$TRACKARTIST")"
TRACKFILE="$(mungefilename "$TRACKNAME")"
GENRE="$(mungegenre "$GENRE")"
- YEAR="$(echo $CDYEAR)"
- # If we want to start the tracks with a given number, we need to modify the
- # TRACKNUM value before evaluation
- do_gettracknum
- # Supported variables for OUTPUTFORMAT are GENRE, ALBUMFILE, ARTISTFILE,
- # TRACKFILE, and TRACKNUM.
+ YEAR=${CDYEAR:-$CDYEAR}
+ # If we want to start the tracks with a given number, we need to modify
+ # the TRACKNUM value before evaluation
+ gettracknum
+ # Supported variables for OUTPUTFORMAT are GENRE, YEAR, ALBUMFILE,
+ # ARTISTFILE, TRACKFILE, and TRACKNUM.
if [ "$VARIOUSARTISTS" = "y" ]; then
OUTPUTFILE="$(eval echo "$VAOUTPUTFORMAT")"
else
OUTPUTFILE="$(eval echo "$OUTPUTFORMAT")"
fi
if checkerrors "tagtrack-$OUTPUT-$1"; then :; else
if [ "$VARIOUSARTISTS" = "y" ]; then
OUTPUTFILE="$(eval echo "$VAOUTPUTFORMAT")"
else
OUTPUTFILE="$(eval echo "$OUTPUTFORMAT")"
fi
if checkerrors "tagtrack-$OUTPUT-$1"; then :; else
- # Once we know the specific output was successful, we can change the OUTPUT to the value containing the container
- case $OUTPUT in
+ # Once we know the specific output was successful, we can change
+ # the OUTPUT to the value containing the container
+ case $TMPOUTPUT in
vorbis|ogg)
OUTPUT=$OGGOUTPUTCONTAINER
;;
flac)
OUTPUT=$FLACOUTPUTCONTAINER
;;
vorbis|ogg)
OUTPUT=$OGGOUTPUTCONTAINER
;;
flac)
OUTPUT=$FLACOUTPUTCONTAINER
;;
+ *)
+ OUTPUT=$TMPOUTPUT
+ ;;
esac
# Check that the directory for OUTPUTFILE exists, if it doesn't, create it
OUTPUTFILEDIR="$(dirname "$OUTPUTDIR/$OUTPUTFILE")"
esac
# Check that the directory for OUTPUTFILE exists, if it doesn't, create it
OUTPUTFILEDIR="$(dirname "$OUTPUTDIR/$OUTPUTFILE")"
for LASTTRACK in $TRACKQUEUE; do :; done
ALBUMFILE="$(mungefilename "$DALBUM")"
ARTISTFILE="$(mungefilename "$DARTIST")"
for LASTTRACK in $TRACKQUEUE; do :; done
ALBUMFILE="$(mungefilename "$DALBUM")"
ARTISTFILE="$(mungefilename "$DARTIST")"
- GENRE=$(mungegenre "$GENRE")
+ GENRE="$(mungegenre "$GENRE")"
YEAR=${CDYEAR:-$CDYEAR}
if [ "$VARIOUSARTISTS" = "y" ] ; then
YEAR=${CDYEAR:-$CDYEAR}
if [ "$VARIOUSARTISTS" = "y" ] ; then
- PLAYLISTFILE=$(eval echo $VAPLAYLISTFORMAT)
+ PLAYLISTFILE="$(eval echo "$VAPLAYLISTFORMAT")"
- PLAYLISTFILE=$(eval echo $PLAYLISTFORMAT)
+ PLAYLISTFILE="$(eval echo "$PLAYLISTFORMAT")"
- FINALPLAYLISTDIR=$(dirname "$OUTPUTDIR/$PLAYLISTFILE")
+ FINALPLAYLISTDIR="$(dirname "$OUTPUTDIR/$PLAYLISTFILE")"
mkdir -p "$FINALPLAYLISTDIR"
if [ -s "$OUTPUTDIR/$PLAYLISTFILE" ]; then
echo -n "Erase, Append to, or Keep the existing playlist file? [e/a/k] (e): " >&2
mkdir -p "$FINALPLAYLISTDIR"
if [ -s "$OUTPUTDIR/$PLAYLISTFILE" ]; then
echo -n "Erase, Append to, or Keep the existing playlist file? [e/a/k] (e): " >&2
do
# Shares some code with do_move since the filenames have to match
CDDBTRACKNUM=$(expr $UTRACKNUM - 1)
do
# Shares some code with do_move since the filenames have to match
CDDBTRACKNUM=$(expr $UTRACKNUM - 1)
- do_getcddbinfo TRACKNAME
splitvarious
TRACKFILE="$(mungefilename "$TRACKNAME")"
ARTISTFILE="$(mungefilename "$TRACKARTIST")"
ALBUMFILE="$(mungefilename "$DALBUM")"
# If we want to start the tracks with a given number, we need to modify the
# TRACKNUM value before evaluation
splitvarious
TRACKFILE="$(mungefilename "$TRACKNAME")"
ARTISTFILE="$(mungefilename "$TRACKARTIST")"
ALBUMFILE="$(mungefilename "$DALBUM")"
# If we want to start the tracks with a given number, we need to modify the
# TRACKNUM value before evaluation
if [ "$VARIOUSARTISTS" = "y" ]; then
if [ "$VARIOUSARTISTS" = "y" ]; then
- OUTPUTFILE=$(eval echo $VAOUTPUTFORMAT)
+ OUTPUTFILE="$(eval echo "$VAOUTPUTFORMAT")"
- OUTPUTFILE=$(eval echo $OUTPUTFORMAT)
+ OUTPUTFILE="$(eval echo "$OUTPUTFORMAT")"
fi
if [ "$VARIOUSARTISTS" = "y" ]; then
if [ "$VAPLAYLISTDATAPREFIX" ] ; then
fi
if [ "$VARIOUSARTISTS" = "y" ]; then
if [ "$VAPLAYLISTDATAPREFIX" ] ; then
echo "Grabbing ${PIPE_MESSAGE}tracks $UTRACKNUM - $LASTTRACK as one track ..." >&2
else
if [ -r "$CDDBDATA" ]; then
echo "Grabbing ${PIPE_MESSAGE}tracks $UTRACKNUM - $LASTTRACK as one track ..." >&2
else
if [ -r "$CDDBDATA" ]; then
- do_getcddbinfo TRACKNAME
echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM: $TRACKNAME..." >&2
else
echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM..." >&2
echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM: $TRACKNAME..." >&2
else
echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM..." >&2
do_discid # Get ABCDETEMPDIR created and status file initialized
;;
musicbrainz)
do_discid # Get ABCDETEMPDIR created and status file initialized
;;
musicbrainz)
else
TRACKNUM=$UTRACKNUM
CDDBTRACKNUM=$(expr $UTRACKNUM - 1)
else
TRACKNUM=$UTRACKNUM
CDDBTRACKNUM=$(expr $UTRACKNUM - 1)
- do_getcddbinfo TRACKNAME