disktool -u ${CDROM#/dev/}
fi
if [ "$CDROMREADERSYNTAX" = "flac" ] ; then
- if [ "$TRACKINFO" = "" ]; then
+ if $METAFLAC $METAFLACOPTS --export-cuesheet-to=- $CDROM > /dev/null 2>&1 ; then
TRACKINFO=$($METAFLAC $METAFLACOPTS --export-cuesheet-to=- $CDROM | $CUE2DISCID)
else
- if $METAFLAC $METAFLACOPTS --export-cuesheet-to=- $CDROM > /dev/null 2>&1 ; then :; else
- log error "the input flac file does not contain a cuesheet."
- exit 1
- fi
+ log error "the input flac file does not contain a cuesheet."
+ exit 1
fi
else
case "$CDDBMETHOD" in
if checkstatus cuefile > /dev/null 2>&1 ; then :; else
CUEFILE=cue-$(echo "$TRACKINFO" | cut -f1 -d' ').txt
vecho "Creating cue file..."
- if $CUEREADER $CUEREADEROPTS > "$ABCDETEMPDIR/$CUEFILE"; then
- echo cuefile=$CUEFILE >> "$ABCDETEMPDIR/status"
- else
- log warning "reading the CUE sheet with mkcue is still considered experimental"
- log warning "and there was a problem with the CD reading. abcde will continue,"
- log warning "but consider reporting the problem to the abcde author"
- fi
+ case $CDROMREADERSYNTAX in
+ flac)
+ if $METAFLAC --export-cuesheet-to=- $CDROM > "$ABCDETEMPDIR/$CUEFILE"; then :; else
+ log warning "the input flac file does not contain a cuesheet."
+ fi
+ ;;
+ *)
+ if $CUEREADER $CUEREADEROPTS > "$ABCDETEMPDIR/$CUEFILE"; then
+ echo cuefile=$CUEFILE >> "$ABCDETEMPDIR/status"
+ else
+ log warning "reading the CUE sheet with mkcue is still considered experimental"
+ log warning "and there was a problem with the CD reading. abcde will continue,"
+ log warning "but consider reporting the problem to the abcde author"
+ fi
+ ;;
+ esac
fi
fi
# If we got the CDPARANOIA status and it is not recorded, save it now
if (( $(echo "${CDDBLOCALRESULTS}" | wc -l) == 1 )); then
CDDBLOCALFILE="${CDDBLOCALRESULTS}"
CDDBLOCALMATCH=single
- echo "${CDDBLOCALRESULTS}" : $(echo "${CDDBLOCALRESULTS}" | wc -l )
- echo CDDBLOCALMATCH=single
elif (( $(echo "${CDDBLOCALRESULTS}" | wc -l) > 1 )); then
CDDBLOCALMATCH=multiple
fi
# If the user has selected to check a local CDDB repo, we proceed with it
case $CDDBLOCALMATCH in
multiple)
- echo "Processing multiple matching CDDB entries..." >> "$ABCDETEMPDIR/cddblocalchoices"
+ echo "Processing multiple matching CDDB entries..." > "$ABCDETEMPDIR/cddblocalchoices"
X=0
echo "$CDDBLOCALRESULTS" | while read RESULT ; do
X=$(expr $X + 1)
# List out disc title/author and contents
CDDBLOCALREAD="$ABCDETEMPDIR/cddblocalread.$X"
- cat "$RESULT" >> "${CDDBLOCALREAD}"
+ cat "$RESULT" > "${CDDBLOCALREAD}"
{
echo -n "#$X: "
do_cddbparse "${CDDBLOCALREAD}"
# List out disc title/author and contents
do_cddbparse "${CDDBLOCALFILE}"
if [ "$CDROMREADERSYNTAX" = "flac" ] ; then
- echo -n "Embedded cuesheet entry found, use ut? [y/n] (y): " >&2
+ echo -n "Embedded cuesheet entry found, use it? [y/n] (y): " >&2
else
echo -n "Locally cached CDDB entry found, use it? [y/n] (y): " >&2
fi
# the user said
# We need the first and last track for cdda2wav
FIRSTTRACK=$2
- LASTTRACK=$3
+ LASTTRACK=$(expr $3 + 0)
UTRACKNUM=$FIRSTTRACK
case "$CDROMREADERSYNTAX" in
flac) READTRACKNUMS="$FIRSTTRACK.1-$(($LASTTRACK + 1)).0" ;;
cdparanoia) READTRACKNUMS="$FIRSTTRACK-$LASTTRACK" ;;
- cdda2wav) READTRACKNUMS="$FIRSTTRACK+$LASTRACK" ;;
+ cdda2wav) READTRACKNUMS="$FIRSTTRACK+$LASTTRACK" ;;
*) echo "abcde error: $CDROMREADERSYNTAX does not support ONETRACK mode"
exit 1 ;;
esac
${NEEDNORMALIZER+$NORMALIZER} ${NEEDEJECT+$EJECT} \
${NEEDDISKTOOL+disktool} ${NEEDCDSPEED+$CDSPEED} \
${NEEDVORBISGAIN+$VORBISGAIN} ${NEEDMP3GAIN+$MP3GAIN} \
- ${NEEDMPPGAIN+$MPPGAIN} \
- ${NEEDCUEREADER+$CUEREADER}
+ ${NEEDMPPGAIN+$MPPGAIN} ${NEEDCUEREADER+$CUEREADER} \
+ ${NEEDCUE2DISCID+$CUE2DISCID}
do
checkexec "$X"
done
DIFF=""
fi
-# Now that we have metaflac, check if we need cue2discid
-case $CDROMREADERSYNTAX in
- flac)
- TRACKINFO=$($METAFLAC --show-tag=CDDB $CDROM | cut -d"=" -f2 | egrep "[a-f0-9]{8}")
- if [ "$TRACKINFO" = "" ]; then
- checkexec ${NEEDCUE2DISCID+$CUE2DISCID}
- fi
- ;;
-esac
+## Now that we have metaflac, check if we need cue2discid
+#case $CDROMREADERSYNTAX in
+# flac)
+# TRACKINFO=$($METAFLAC --show-tag=CDDB $CDROM | cut -d"=" -f2 | egrep "[a-f0-9]{8}")
+# if [ "$TRACKINFO" = "" ]; then
+# checkexec ${NEEDCUE2DISCID+$CUE2DISCID}
+# fi
+# ;;
+#esac
CDROMREADER="$CDROMREADER $CDROMREADEROPTS"
CDDBTOOL="$CDDBTOOL $CDDBTOOLOPTS"
esac
if [ "$DOCDDB" = "y" ]; then
+ # start with a sane default:
+ CDDBLOCALSTATUS=notfound
if [ $CDDBUSELOCAL = "y" ]; then
do_localcddb
fi