Added selection of first and lasttrack on onetrack mode
authorJesus Climent <mooch@debian.org>
Wed, 15 Jun 2005 13:22:25 +0000 (13:22 +0000)
committerJesus Climent <mooch@debian.org>
Wed, 15 Jun 2005 13:22:25 +0000 (13:22 +0000)
Some logic for onetrack mode added
2 lines were missing... restored

abcde

diff --git a/abcde b/abcde
index 92f996f..41a5a15 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -62,6 +62,7 @@ echo "-W <#> Contatenate CDs: -T #01 -w \"CD #\""
 echo ""
 echo "Tracks is a space-delimited list of tracks to grab."
 echo "Ranges specified with hyphens are allowed."
+#echo "Double hyphens are used to concatenate tracks"
 }
 
 # Funtions to replace the need of seq, which is too distribution dependant.
@@ -1774,8 +1775,8 @@ do_cdread ()
                FIRSTTRACK=$2
                LASTTRACK=$3
                case "$CDROMREADERSYNTAX" in
-                       cdparanoia) UTRACKNUM="1-" ;;
-                       cdda2wav) UTRACKNUM="1+$LASTRACK" ;;
+                       cdparanoia) UTRACKNUM="$FIRSTTRACK-$LASTTRACK"
+                       cdda2wav) UTRACKNUM="$FIRSTTRACK+$LASTRACK" ;;
                        *) echo "abcde error: $CDROMREADERSYNTAX does not support ONETRACK mode"
                           exit 1 ;;
                esac
@@ -1801,11 +1802,15 @@ do_cdread ()
                esac
                REDIR=">&2"
        fi
-       if [ -r "$CDDBDATA" ]; then
-               TRACKNAME=$(grep ^TTITLE$CDDBTRACKNUM= "$CDDBDATA" | head -n 1 | cut -f2 -d= | tr -d \[:cntrl:\])
-               echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM: $TRACKNAME..." >&2
+       if [ "$1" = "onetrack" ]; then
+               echo "Grabbing ${PIPE_MESSAGE}tracks $UTRACKNUM..." >&2
        else
-               echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM..." >&2
+               if [ -r "$CDDBDATA" ]; then
+                       TRACKNAME=$(grep ^TTITLE$CDDBTRACKNUM= "$CDDBDATA" | head -n 1 | cut -f2 -d= | tr -d \[:cntrl:\])
+                       echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM: $TRACKNAME..." >&2
+               else
+                       echo "Grabbing ${PIPE_MESSAGE}track $UTRACKNUM..." >&2
+               fi
        fi
        case "$CDROMREADERSYNTAX" in
                cdparanoia) nice $READNICE $CDROMREADER -d $CDROM $UTRACKNUM $FILEARG $REDIR ;;
@@ -2815,6 +2820,8 @@ do
                        fi
                fi
        fi
+       if [ "$DOTAG" = "y" ]; then
+               if checkstatus encodetrack-$UTRACKNUM; then
                        if checkstatus tagtrack-$UTRACKNUM; then :; else do_tag $UTRACKNUM; fi
                fi
        fi