Skip to content

Commit

Permalink
fix: max vs min seeding time check (#596)
Browse files Browse the repository at this point in the history
* fix: max vs min seeding time check

Allow max_seeding_time to be unlimited (-1) even if a min_seeding_time is set

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
bakerboy448 and pre-commit-ci[bot] authored Jun 29, 2024
1 parent 400bd16 commit 291a8ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,13 @@ def _sort_share_limits(share_limits):
self.share_limits[group]["torrents"] = []
if (
self.share_limits[group]["min_seeding_time"] > 0
and self.share_limits[group]["max_seeding_time"] != -1
and self.share_limits[group]["min_seeding_time"] > self.share_limits[group]["max_seeding_time"]
):
err = (
f"Config Error: min_seeding_time ({self.share_limits[group]['min_seeding_time']}) is greater than "
f"max_seeding_time ({self.share_limits[group]['max_seeding_time']}) for the grouping '{group}'.\n"
f"min_seeding_time must be less than or equal to max_seeding_time."
f"min_seeding_time must be less than or equal to max_seeding_time or max_seeding_time must be unlimited (-1)."
)
self.notify(err, "Config")
raise Failed(err)
Expand Down

0 comments on commit 291a8ae

Please sign in to comment.