Introduced -f to force local cddb or template
authorJesus Climent <mooch@debian.org>
Mon, 30 Aug 2004 06:28:25 +0000 (06:28 +0000)
committerJesus Climent <mooch@debian.org>
Mon, 30 Aug 2004 06:28:25 +0000 (06:28 +0000)
README
abcde
abcde.1
debian/changelog

diff --git a/README b/README
index 82e4a32..24fc47f 100644 (file)
--- a/README
+++ b/README
@@ -68,6 +68,8 @@ Changes in 2.2-pre2:
   system.
 * New mungegenre function to switch off (or modify) the default behaviour of
   transforming uppercase characters to lowercase.
+* No network but you have been using abcde with local CDDB storage before?
+  Use -f and it will try the local CDDB and fallback to an empty template.
 
 Changes in 2.2-pre1:
 
diff --git a/abcde b/abcde
index a447509..1d16606 100755 (executable)
--- a/abcde
+++ b/abcde
@@ -26,7 +26,7 @@ echo "-c    Specify a configuration file (overrides system and user config files
 echo "-C    Specify discid to resume from (only needed if you no longer have the cd)"
 echo "-d    Specify CDROM device to grab"
 echo "-D    Debugging mode (equivalent to sh -x abcde)"
-#echo "-f    Force the use of a local CDDB entry. Otherwise use an empty template"
+echo "-f    Force the use of a local CDDB entry. Use an empty template if not found"
 echo "-h    This help information"
 #echo "-i    Tag files while encoding, when possible (local only) -NWY-"
 echo "-j    Number of encoder processes to run at once"
@@ -1017,36 +1017,41 @@ do_localcddb ()
                USELOCALRESP="y"
                
                # If the user has selected to check a local CDDB repo, we proceed with it
-               if [ "$CDDBUSELOCAL" = "y" ]; then
-                       if [ -r "${CDDBLOCALFILE}" ]; then
-                               # List out disc title/author and contents
-                               do_cddbparse "${CDDBLOCALFILE}"
-                               echo -n "Locally cached CDDB entry found, use it? [y/n] (y): "
-                               if [ "$INTERACTIVE" = "y" ]; then
+               if [ -r "${CDDBLOCALFILE}" ]; then
+                       # List out disc title/author and contents
+                       do_cddbparse "${CDDBLOCALFILE}"
+                       echo -n "Locally cached CDDB entry found, use it? [y/n] (y): "
+                       if [ "$INTERACTIVE" = "y" ]; then
+                               read USELOCALRESP
+                               while [ "$USELOCALRESP" != "y" ] && [ "$USELOCALRESP" != "n" ] && [ "$USELOCALRESP" != "" ] ; do
+                                       echo -n 'Invalid selection. Please answer "y" or "n": '
                                        read USELOCALRESP
-                                       while [ "$USELOCALRESP" != "y" ] && [ "$USELOCALRESP" != "n" ] && [ "$USELOCALRESP" != "" ] ; do
-                                               echo -n 'Invalid selection. Please answer "y" or "n": '
-                                               read USELOCALRESP
-                                       done
-                                       [ x"$USELOCALRESP" = "x" ] && USELOCALRESP="y"
-                               else
-                                       echo "y" >&2
-                               fi
-                               if [ "$USELOCALRESP" = "y" ]; then
-                               #echo "Using local copy of CDDB data"
-                                       cp "${CDDBLOCALFILE}" "$ABCDETEMPDIR/cddbread.1"
-                                       echo 999 > "$ABCDETEMPDIR/cddbquery" # Assuming 999 isn't used by CDDB
-                                       echo cddb-readcomplete >> "$ABCDETEMPDIR/status"
-                                       do_cddbparse "${CDDBLOCALFILE}" > "$ABCDETEMPDIR/cddbchoices"
-                                       echo cddb-choice=1 >> "$ABCDETEMPDIR/status"
-                                       CDDBLOCALSUCCESS="y"
-                               else
-                                       #echo "Not using local copy of CDDB data"
-                                       CDDBLOCALSUCCESS="n"
-                               fi
+                               done
+                               [ x"$USELOCALRESP" = "x" ] && USELOCALRESP="y"
+                       else
+                               echo "y" >&2
+                       fi
+                       if [ "$USELOCALRESP" = "y" ]; then
+                       #echo "Using local copy of CDDB data"
+                               cp "${CDDBLOCALFILE}" "$ABCDETEMPDIR/cddbread.1"
+                               echo 999 > "$ABCDETEMPDIR/cddbquery" # Assuming 999 isn't used by CDDB
+                               echo cddb-readcomplete >> "$ABCDETEMPDIR/status"
+                               do_cddbparse "${CDDBLOCALFILE}" > "$ABCDETEMPDIR/cddbchoices"
+                               echo cddb-choice=1 >> "$ABCDETEMPDIR/status"
+                               CDDBLOCALSUCCESS="y"
                        else
+                               #echo "Not using local copy of CDDB data"
                                CDDBLOCALSUCCESS="n"
                        fi
+               elif [ "$FORCECDDBUSELOCAL"= "y" ]; then
+                       $CDDBTOOL template $(cat "$ABCDETEMPDIR/discid") > "$ABCDETEMPDIR/cddbread.0"
+                       echo 998 > "$ABCDETEMPDIR/cddbquery" # Assuming 998 isn't used by CDDB
+                       echo cddb-readcomplete >> "$ABCDETEMPDIR/status"
+                       do_cddbparse "${CDDBLOCALFILE}" > "$ABCDETEMPDIR/cddbchoices"
+                       echo cddb-choice=0 >> "$ABCDETEMPDIR/status"
+                       CDDBLOCALSUCCESS="y"
+               else
+                       CDDBLOCALSUCCESS="n"
                fi
        fi
 }
@@ -1308,6 +1313,10 @@ do_cddbedit ()
                                if [ "$USELOCALRESP" = "y" ]; then :; else
                                        if [ -n "$CHOICE" ] ; then
                                                case $CDDBCHOICES in
+                                                       0) 
+                                                       UNKNOWNDISK=y
+                                                       echo "Selected template."
+                                                       ;;
                                                        1) cat "$ABCDETEMPDIR/cddbchoices" ;;
                                                        *)
                                                        echo "Selected: #$CHOICE"
@@ -1867,7 +1876,7 @@ fi
 
 # Parse command line options
 #while getopts 1a:bc:C:d:Dhj:klLnNo:pr:S:t:T:vVx opt ; do
-while getopts 1a:A:bc:C:d:Dhj:klLnNo:pr:Rs:S:vVx opt ; do
+while getopts 1a:A:bc:C:d:Dfhj:klLnNo:pr:Rs:S:vVx opt ; do
        case "$opt" in
                1) ONETRACK=y ;;
                a) ACTIONS="$OPTARG" ;;
@@ -2127,7 +2136,7 @@ HTTPGET="$HTTPGET $HTTPGETOPTS"
 
 # Here it used to say:
 # One thousand lines in, we can start doing stuff with things
-# Well, right now we are at line 2116 ;)
+# Well, right now we are at line 2139 ;)
 
 # List of valid actions: cddb,read,normalize,encode,tag,playlist,move,clean
 # List of experimental actions: retag,transcode
diff --git a/abcde.1 b/abcde.1
index e1ae473..eb79db5 100644 (file)
--- a/abcde.1
+++ b/abcde.1
@@ -66,6 +66,10 @@ CD\-ROM block device that contains audio tracks to be read.
 Capture debugging information (you'll want to redirect this \- try 'abcde \-D
 2>logfile')
 .TP
+.B \-f
+Force the use of a locally cached CDDB entry and fallback to a template if none
+is found. For faster network-disconnected operation.
+.TP
 .B \-j [number]
 Start [number] encoder processes at once. Useful for SMP systems. Overrides
 the MAXPROCS configuration variable. Set it to "0" when using distmp3 to avoid
index 235dddd..f43ee10 100644 (file)
@@ -16,7 +16,7 @@ abcde (2.1pre2.2.0-1) experimental; urgency=low
     (Closes: #95828). Geez! That is low bug number...
   * DATA tracks are now excluded from the ripping process using internally
     the cdparanoia "-Q" query option. If using another ripper, it does not
-    work (at least there is no support for them in abcde) 
+    work (at least there is no support for them in abcde)
     (Closes: #112692, #117412).
   * New "0" choice for "None of the above" has been introduced. If selected, a
     template is created and the user encouraged to edit it (Closes: #147683).
@@ -35,8 +35,9 @@ abcde (2.1pre2.2.0-1) experimental; urgency=low
     interaction.
   * Changes normalize to normalize-audio (Closes: #267053)
   * Copes with wav files being erased by the ripping tool.
+  * New -f to force local CDDB or fallback to template (no network).
 
- -- Jesus Climent <jesus.climent@hispalinux.es>  Sun, 29 Aug 2004 00:34:19 +0300
+ -- Jesus Climent <jesus.climent@hispalinux.es>  Mon, 30 Aug 2004 06:22:35 +0000
 
 abcde (2.1.19-1) unstable; urgency=low