From 5704f6e52dca5a0ad2988e35360126a990eb1f5d Mon Sep 17 00:00:00 2001 From: bobokun Date: Tue, 13 Jun 2023 09:48:23 -0400 Subject: [PATCH] fix bug applying share limits --- VERSION | 2 +- modules/core/share_limits.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index fd82f41..b60b2e7 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.0.1-develop6 +4.0.1-develop7 diff --git a/modules/core/share_limits.py b/modules/core/share_limits.py index 291a6aa..cba0dc1 100644 --- a/modules/core/share_limits.py +++ b/modules/core/share_limits.py @@ -347,14 +347,15 @@ class ShareLimits: if not self.config.dry_run: if tags and tags not in torrent.tags: torrent.add_tags(tags) - if limit_upload_speed is not None: + torrent_upload_limit = -1 if round(torrent.up_limit / 1024) == 0 else round(torrent.up_limit / 1024) + if limit_upload_speed is not None and limit_upload_speed != torrent_upload_limit: if limit_upload_speed == -1: torrent.set_upload_limit(-1) else: torrent.set_upload_limit(limit_upload_speed * 1024) - if max_ratio is not None: + if max_ratio is None: max_ratio = torrent.max_ratio - if max_seeding_time is not None: + if max_seeding_time is None: max_seeding_time = torrent.max_seeding_time if "MinSeedTimeNotReached" in torrent.tags: return []