[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[abcde] cddb-tool gives incorrect result with an inexact match



Using version abcde 1.9.1 and bash 2.04, the cddb-tool returns from
the query:

cddb-tool query "http://freedb.freedb.org/~cddb/cddb.cgi" foo \
bar a909cb0d 13 150 12362 23167 42370 53900 66075 80417 95597 \
113355 135410 146997 162350 174532 2509

(a Skydiggers CD)

with the output all on one line (only one match, but inexact). This
causes abcde to not properly interpret the result (cddbchoices has
only one line: 

Multiple inexact matches:

This gives the user a choice between [1--1] (pick between 1 and -1,
though it will accept no input that I could guess). My remedy for this
was to change one of the lines in cddb-tool as follows:

--- cddb-tool   Thu Aug 17 23:02:51 2000
+++ /usr/bin/cddb-tool  Thu Aug 31 09:30:59 2000
@@ -223,7 +223,7 @@
        TRACKINFO="$@"
        TRACKINFOPLUS=$(echo $TRACKINFO | tr ' ' '+')
        RESULTS=$($WGET -q -O - "$SERVER?cmd=cddb+query+$TRACKINFOPLUS\&hello=$HELLOINFO\&proto=3") || exit $LOOKUP_ERR
-       echo $RESULTS | tr -d '\r'
+       echo $RESULTS | tr '\r' '\n' | sed 's/^ //g'
        ;;
 
 read) # cddb-tool read serverurl user host genre discnumber

---------

Instead of just removing the '\r's, it now changes them to '\n's and
removes spaces at the beginning of lines. This is because, with bash
(2.04), the "RESULTS=$($WGET" line results in each line terminating
with a '\r' follow by a ' '. A problem with this fix is that it
results in one too many lines (an additional blank one), asking the
user to choose between the real entry and an empty one.

Is this the proper forum for this type of discussion? As Debian's
Unstable still doesn't have the 1.9.1 .deb, I didn't think it was
suitable to post a bug report through the normal Debian channels.

Also, I have a patch to allow an additional configuration option:
'nice'ness of the encoding, if anyone is out there (and/or
interested).

Kevin.


To unsubscribe: echo unsubscribe | mail abcde-request@whimsica.lly.org