Skip to content
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

Add ability to skip tracks #260

Closed
wants to merge 4 commits into from
Closed

Conversation

waweic
Copy link

@waweic waweic commented Apr 8, 2018

It works, but is propably not using the best way to do this

Shorten one line for flake8 compliance
@walterav1984
Copy link

walterav1984 commented Apr 26, 2018

I tested this patch successful on older whipper 0.5.1 commit 1247c94 + 88c7abc using the following command:

python2 -m whipper cd rip --exclude-tracks "2,3,4,5,6,7,8,9,10,11,12,13"

This will successfully rip track 1&14 of a 14 track CD. I haven't tested CD's with more than 100th tracks but its easy to work with, although the LOG indeed says excluded rips are done 100%.

However if I use current git master commit db8050d whipper version 0.7.0, it seems that skipping/excluding the first track will have difficulty reading only the last 14th track and fails. Giving offset /zero/checksum errors. I'll try to upload those log errors later.

Tested using two different drives Samsung usb and HL LG sata each verified different offset +6/+667.

@@ -455,7 +461,16 @@ def _ripIfNotRipped(number):
self.ittoc.getTrackLength(number), number)

self.program.saveRipResult()

try:
Copy link
Contributor

@RecursiveForest RecursiveForest Jun 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be preferable to just check whether the option is the empty string or not if you were going to do it this way. See further comments.

try:
excluded_tracks_integer.append(int(i.replace(" ", "")))
except ValueError:
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of silently ignoring errors, we should abort at argument-handling time with a helpful yet short error message.

excluded_tracks = self.options.excluded_tracks.split(",")
except UnboundLocalError:
excluded_tracks = []
excluded_tracks_integer = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the array of excluded tracks in options.excluded_tracks.

action="store", dest="excluded_tracks",
default="",
help="Comma separated list of tracks to "
"exclude. This will propably mess up "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be best to handle the logging situation as part of implementing this feature. We'd like to avoid having incompatible features butting heads.

except UnboundLocalError:
excluded_tracks = []
excluded_tracks_integer = []
for i in excluded_tracks:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to parse the track listing in the handle_arguments() method. I also bet there's a way to tell argparse to expect a variable number of integers, which will save us from having to manually typecast strings to integers.

@RecursiveForest
Copy link
Contributor

Thanks for the contribution. I've left a few comments I think should be addressed before we continue. I'll need input from the rest of the team on whether we want to implement this feature or not. Another option would be to implement a "rip only these tracks" feature, something I see as a little easier to use than a blacklist.

@walterav1984 thanks for testing.

Do either of you think you'd be able to contribute unit tests of this functionality?

@walterav1984
Copy link

@RecursiveForest

What would you mean by unit tests?

@walterav1984
Copy link

I can confirm that indeed the comparisons of the checksums will fail (mismatch) since it uses the hash of the previous/skipped n-th track.

Sorry for not providing a descent log, will try in future to reproduce.

@JoeLametta
Copy link
Collaborator

JoeLametta commented Nov 7, 2019

No activity for a long time: closed.

@JoeLametta JoeLametta closed this Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants