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

--start-volume & --end-volume functionality addition #113

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

joeressler
Copy link

While development is being made on the --range CLI arg, I modified chapter.py, args_parser.py, url.py, and main.py to add the cli args --start-volume and --end-volume, mirroring the --start-chapter and --end-chapter args.

Changed chapter.py, args_parser.py, url.py, and main.py
Comment on lines 499 to 506
if is_vol_number and num_vol > 0.0:
if self.start_volume is not None and not (num_vol >= self.start_volume):
log.debug(f"Ignoring chapter in volume {num_vol}, because volume {num_vol} is in ignored list")
return False
if self.end_volume is not None and not (num_vol <= self.end_volume):
log.debug(f"Ignoring chapter in volume {num_vol}, because volume {num_vol} is in ignored list")
return False

Copy link
Owner

Choose a reason for hiding this comment

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

This volume checking must be placed before chapter checking, if both start/end chapter and volume is used then --start-volume and --end-volume won't be useful enough.

For example:

mangadex-dl "https://mangadex.org/title/a96676e5-8ae2-425e-b549-7f15dd34a6d8/komi-san-wa-komyushou-desu" --start-chapter 1 --end-chapter 43 --start-volume 1 --end-volume 2

The user wants to stop download at volume number 2 but because of --end-chapter is set to 43, then it will continue to download until chapter 43, not until volume 2. Which you can see in provided MangaDex link above, volume 2 stopped at chapter 34

Overall, this PR looks good, i will try test and merge it once the fix is resolved 👍

Copy link
Owner

Choose a reason for hiding this comment

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

If you are confused, it should be like this !

image

I'm sorry i cannot use git diff in Github 🗿, so i use text comparer in devtoys

Moved the volume checking to be before chapter checking to avoid any issues
@mansuf mansuf linked an issue Jul 17, 2024 that may be closed by this pull request
@mansuf mansuf changed the base branch from main to v3.0.0 July 17, 2024 09:55
@mansuf mansuf changed the base branch from v3.0.0 to main July 17, 2024 09:55
@mansuf
Copy link
Owner

mansuf commented Jul 17, 2024

Merged into main, later it will be synchronized to v3.0.0 branch (merge conflict). Thank you for your contribution 💖

@mansuf mansuf merged commit 9a2649b into mansuf:main Jul 17, 2024
3 of 4 checks passed
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.

add end/start volume option
2 participants