-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added --keep-going option to cd rip command #524
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💖 Thanks for opening your first pull request here! 💖
While doing some testing I noticed that if a track gets skipped then the AccurateRip\cuesheet generation stage will crash with a Working on fixing this, please don't merge until I do |
Maybe it makes sense to return a non-zero exit code at the end of the process in case some tracks could not be fully ripped. Some tools automate CD ripping with whipper, and would potentially like to know if they should re-try a certain CD later. Either that, or perhaps printing a clear list of failed tracks to Thanks for working on this. |
Thanks for the pull request! |
Hi everyone this should be ready to merge now. @JoeLametta I've added to the logger the capability to report that individual tracks have been skipped, if any tracks are skipped it will be mentioned in the @MerlijnWajer I could also add a non zero exit or a list of skipped tracks to |
blueblots:
All right, I'll review and test it as soon as possible (tomorrow probably). blueblots:
I think that would be a worthwhile addition. @itismadness As you've got more real world experience with whipper log parsing, does this pull request look OK to you? |
@blueblots I've tested the code and it seems to be working. I've added some comments too.
One thing that still needs to be done is adding an entry about this option into whipper cd rip's manpage: I'll do it. |
Hi, I've noticed that the Example CD-R with skipped tracks 7, 9, 10 (m3u)
The cue sheet references all tracks too but the skipped ones don't have a corresponding Example CD-R with skipped tracks 7, 9, 10 (cue sheet)
|
I don't have a CD I can test this with, but it should just skip over all of them and exit (after exceeding
For tracks that are skipped, AccurateRip just reports that the track isn't found in the database. Tracks that are ripped are still checked normally. The log output of AccurateRip will state that skipped tracks are not accurate, which seems appropriate to me. |
Probably it should be, because someone might try to use it as a playlist and would have missing files from the list.
I don't actually use cue sheets myself, and I'm not sure what exactly the appropriate use for them is currently. Some people say its for playlists, others for ripping the CD and there seems to be varying formats available. I'm not sure if the |
I may check what happens by purposefully damaging the CD-R I've already used in my previous test...
All right, that's fine.
I agree.
The purpose of the cue sheet in whipper should be to give users a way to burn the ripped audio tracks to a CD recreating the same layout (tracks order, indexes, gaps). Of course that requires that all the tracks must be ripped and available. After #115 will be implemented, then it could also be used as a playlist file. TL;DR: Cue sheets of incomplete rips are nearly useless. Some useful resources about cue sheets: |
Example CD-R with skipped tracks 7, 9, 10 (cue sheet)
Right now in whipper every Sample excerpt from the above cue sheet:
Because of the missing I think there are two ways to "solve" this issue:
@MerlijnWajer What's your opinion about this? |
Wouldn't it be better if the skipped tracks were just omitted from the cue sheet? If the cue sheet references a non existent file then attempts to burn it to a CD might fail. |
IMO it would be better to maintain rather complete cue sheets, with file entries pointing to non-existing tracks. |
I think that may cause issues with gaps (INDEX command). |
OK I will go back and change this to putting a filename on the cue sheet whether or not the track rips. |
See the latest commit, the above should no longer be issues. |
Sorry for the late reply: I still haven't tested the new changes in commit caeeeac. Is this pull request finished for you? If affirmative, I'll review it as soon as possible, add a warning about the non-functioning cue sheet and an entry regarding to this option in whipper's manpage. |
Yes I'm pretty much finished with it, thank you for reviewing this. |
if len(self.skipped_tracks) > 0: | ||
logger.warning('%d tracks have been skipped from this rip attempt', | ||
len(self.skipped_tracks)) | ||
return 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 5? I understand this is the exit code, but how did you pick 5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 is arbitrary, I just noticed that 5 wasn't being used for anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe exit codes should be documented somewhere user facing (ie., not just in the code)? And maybe it would be better to use powers of two for exit codes so bitmasking could potentially be used to check for multiple error conditions down the line?
Implemented the option (`-k`, `--keep-going`) to continue ripping the CD even if one track fails to rip (as @xmixahlx suggested in #128). Requested in #128 Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com> Changed line-lengths/indentation of some code Travis-CI was failing on account of lines being under-indented or too long, this should correct it. Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Made changes to fix `KeyError` and implemented logging of skipped tracks. For instance: if any tracks are skipped, the log will show: `Health status: Some tracks were not ripped (skipped)`. the tracks that are skipped will show: `Status: Track not ripped (skipped)`. Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Added an exit status of 5 when tracks are skipped during a rip attempt. Fixed a TypeError caused by a syntax error in the format string on line 537 in `whipper/command/cd.py`. Changed f-string to printf-style format string on line 493 in `whipper/command/cd.py`. Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Removed `return None` from the `Rip.doCommand` method as suggested in review comments. Changed logging strings to use logger arguments rather than printf-string, as suggested in review comments. Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Added conditional to `program.write_m3u()` to ignore skipped tracks. Added skipped_tracks support to the `Program` and `image.ImageVerifyTask` classes to avoid crashing when a file for a skipped track doesn't exist. Added conditional to `accurip.calculate_checksums` to check if a path exists before trying to calculate checksums, this prevents `accuraterip-checksum.c` from emitting an error message (`sf_open failed!`) when a path doesn't exist (as when a track is skipped). Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
This happens when a track fails to be ripped and gets skipped. Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Merged, thanks! |
On 84e4ef6
this error is still present:
|
@wisp3rwind , thank you for reporting this. I will look into this by the end of the week. In the meantime, could you let me know how you installed whipper, e.g. is this from Github or a package from a Linux distro? |
Hi @blueblots, this is on Arch, whipper is whipper-git from the AUR. Thanks for looking into this, and your work on this features in general! |
Hi @wisp3rwind , I haven't been able to replicate the crash on my end so far (using both the source and the AUR package on Arch). Are there any more details you can provide that may be relevant? |
Not at the moment, I don't have access to the faulty disc right now to get a debug log. I can probably do so in a week. I skimmed the code, and I'd guess that the problem is somehow related to how paths are stored in the whipper/whipper/common/program.py Lines 617 to 619 in 84e4ef6
whipper/whipper/image/image.py Lines 152 to 160 in 84e4ef6
compares that path to the one stored in the cue file, which is |
@wisp3rwind I've checked and I agree with your diagnosis. It seems that when ripping to an output directory ( whipper/whipper/image/image.py Line 155 in 84e4ef6
The issue can be fixed adding a |
I've looked at it today myself and saw the same issue with that I'll be sending the fix shortly, once I fully test it. |
@JoeLametta would it be better to just do the Edit: I think the Edit 2: Having read the code further, I think it would be best to fix the |
@JoeLametta I've opened a pull request for the fix, its on #537. I was able to reproduce the crash on my end after omitting the I haven't pinpointed yet where the |
All right, I'm waiting for a test to complete before merging it. 👌
Hi, I think it's getting added here: whipper/whipper/common/program.py Line 242 in b6338b2
When the output directory option isn't specified, it defaults to |
The fix has been published in the |
On current git tip, this specific error appears to be gone. Now I'm getting the following error (which is probably unrelated):
However, my network is pretty stable, and the same error occured again when repeating the rip. |
I've never had an error like that before... is it possible that Accuraterip's server was down/under maintenance? In any case it would probably be better if there was some |
Don't know but it seems possible (Server: @wisp3rwind Maybe it's better to discuss this in a new issue. Similar to #522. |
Implemented the option (
-k
,--keep-going
) to continue ripping the CD even if one track fails to rip (as @xmixahlx suggested in #128). So this command:Would try to rip a problematic track 8 times, then continue on to the next track on the CD if the track fails to rip.
Signed-off-by: blueblots 63152708+blueblots@users.noreply.github.com