Bug 18

Summary: commandline parser misbehaves with open-ended trackspec
Product: abcde Reporter: Tom Roche <Tom_Roche>
Component: RippingAssignee: Steve McIntyre <steve>
Status: CONFIRMED ---    
Severity: normal CC: andrew.david.strong
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   

Description Tom Roche 2015-11-03 23:14:30 GMT
As currently indicated @ https://wiki.debian.org/Ripping#handling_broken_tracks , `abcde` currently has problems "doing the right thing" with broken tracks. As noted @ FR_URI_HERE , users currently cannot tell `abcde` to "just rip the tracks you can." This problem is exacerbated by this bug, illustrated by the following (real-life) example:

# start example 0-----------------------------------------------------
me@it:~$ abcde -c ~/.config/abcde/abcde-MP3.conf
Looking at EXTRAVERBOSE ()
Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Retrieved 1 Musicbrainz match...done.
---- Louis Armstrong / The Complete Hot Five and Hot Seven Recordings ----
1: Gut Bucket Blues
2: My Heart
3: Yes! I'm in the Barrel
4: Come Back, Sweet Papa
5: Georgia Grind
6: Heebie Jeebies
7: Cornet Chop Suey
8: Oriental Strut
9: You're Next
10: Muskrat Ramble
11: Don't Forget to Mess Around
12: I'm Gonna Gitcha
13: Droppin' Shucks
14: Who'sit
15: King of the Zulus
16: Big Fat Ma and Skinny Pa
17: Lonesome Blues
18: Sweet Little Papa
19: Jazz Lips
20: Skid-Dat-De-Dat
21: Big Butter and Egg Man
22: Sunset Cafe Stomp
23: You Made Me Love You
24: Irish Black Bottom
25: [silence]

Edit selected CDDB data [y/N]? 
Is the CD multi-artist [y/N]? 
# ...

outputting to /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-/track16.wav

 (== PROGRESS == [   >                          | 190854 00 ] == :^D   ==)   Tagging track 15 of 25: King of the Zulus...
WARNING: The CDROM drive appears to be seeking impossibly quickly.-P   ==)   
This could be due to timer bugs, a drive that really is improbably fast,
or, most likely, a bug in cdparanoia's cache modelling.

Please consider using the -A option to perform an analysis run, then mail
the cdparanoia.log file produced by the analysis to paranoia-dev@xiph.org
to assist developers in correcting the problem.

 (== PROGRESS == [       +C+>                   | 193412 00 ] == ;-( 0 ==)   scsi_read error: sector=193442 length=1 retry=0
                 Sense key: 2 ASC: 3a ASCQ: 2
                 Transport error: Device not ready
                 System error: No medium found
scsi_read error: sector=193443 length=27 retry=0
                 Sense key: 2 ASC: 3a ASCQ: 2
                 Transport error: Device not ready
                 System error: No medium found

paranoia_read: CDROM drive unavailable, bailing.

[ERROR] abcde: The following commands failed to run:
readtrack-16: cdparanoia --never-skip=40 returned code 1
Finished. Not cleaning /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-.

me@it:~$ abcde -c ~/.config/abcde/abcde-MP3.conf 17-
Looking at EXTRAVERBOSE ()
Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# ...

Erase, Append to, or Keep the existing playlist file? [e/a/k] (e): 
Grabbing track 01: Gut Bucket Blues...
cdparanoia III release 10.2 (September 11, 2008)

Ripping from sector       0 (track  1 [0:00.00])
          to sector   12204 (track  1 [2:42.54])

outputting to /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-/track01.wav
^C # WRONG!
#   end example 0-----------------------------------------------------

I don't believe there is any reasonable interpretation under which the current functioning is correct--am I missing something? If so, feel free to convert this to a feature request.

Fortunately, I (unlike `abcde` currently :-) am smart enough to note the number of the last track, and to convert the open-ended commandline "trackspec" (for want of a better term) `17-` into the "fully-qualified trackspec" `17-25`. When I use that FQT, `abcde` does what I want:

# start example 1----------------------------------------------------
me@it:~$ abcde -c ~/.config/abcde/abcde-MP3.conf 17-25
Looking at EXTRAVERBOSE ()
Grabbing tracks: 17 18 19 20 21 22 23 24
abcde: attempting to resume from /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-..
Creating playlist...
Grabbing track 17: Lonesome Blues...
cdparanoia III release 10.2 (September 11, 2008)

Ripping from sector  203270 (track 17 [0:00.00])
          to sector  217121 (track 17 [3:04.51])

outputting to /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-/track17.wav
# ... 
#   end example 1----------------------------------------------------

YMMV, but my contention is

 1. The current behavior is buggy: `abcde` should not, when given an "open-ended trackspec" (OET) like `17-`, start reading from track#=1.

 2. The correct, DWIM way to handle an OET is to note the end track#, programmatically convert the OET into the corresponding FQT, and then handle the generated FQT as is done presently.
Comment 1 Tom Roche 2015-11-04 00:09:41 GMT
s|FR_URI_HERE|http://abcde.einval.com/bugzilla/show_bug.cgi?id=20|g