Skip to content

Commit

Permalink
Fixing volume check order
Browse files Browse the repository at this point in the history
Moved the volume checking to be before chapter checking to avoid any issues
  • Loading branch information
joeressler committed Jul 17, 2024
1 parent 82fdfd2 commit e4df189
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions mangadex_downloader/chapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,14 @@ def _check_range_chapter_legacy(self, chap):

is_number = isinstance(num_chap, float)
is_vol_number = isinstance(num_vol, float)

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

# There is a chance that "Chapter 0" is Oneshot or prologue
# We need to verify that is valid oneshot chapter
Expand All @@ -496,13 +504,6 @@ def _check_range_chapter_legacy(self, chap):
log.debug(f"Ignoring chapter {num_chap}, because chapter {num_chap} is in ignored list")
return False

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

if chap.oneshot and self.no_oneshot and not self.all_group:
log.debug("Ignoring oneshot chapter since it's in ignored list")
Expand Down

0 comments on commit e4df189

Please sign in to comment.