From 3b77664b2763ce9bcc0369c737779f5c6ae6cc14 Mon Sep 17 00:00:00 2001 From: Feramance Date: Wed, 3 Jul 2024 10:55:29 +0200 Subject: [PATCH] Added auto pause resume check for free space subprocess --- qBitrr/arss.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/qBitrr/arss.py b/qBitrr/arss.py index b8535edd..ab744225 100755 --- a/qBitrr/arss.py +++ b/qBitrr/arss.py @@ -5136,10 +5136,7 @@ def _process_single_torrent(self, torrent): self.current_free_space, free_space_test, ) - if ( - torrent.state_enum != TorrentStates.PAUSED_DOWNLOAD - and self.current_free_space < torrent["amount_left"] - ): + if torrent.state_enum != TorrentStates.PAUSED_DOWNLOAD and free_space_test < 0: self.logger.info( "Pause download [%s]: Free space %s -> %s", torrent.name, @@ -5167,10 +5164,7 @@ def _process_single_torrent(self, torrent): ) self.current_free_space = free_space_test torrent.remove_tags(tags=["qBitrr-free_space_paused"]) - elif ( - torrent.state_enum == TorrentStates.PAUSED_DOWNLOAD - and self.current_free_space > torrent["amount_left"] - ): + elif torrent.state_enum == TorrentStates.PAUSED_DOWNLOAD and free_space_test > 0: self.logger.info( "Unpause download [%s]: Free space %s -> %s", torrent.name, @@ -5301,7 +5295,7 @@ def build_arr_instances(self): continue except (OSError, TypeError) as e: self.logger.exception(e) - if FREE_SPACE != "-1": + if FREE_SPACE != "-1" and AUTO_PAUSE_RESUME: managed_object = FreeSpaceManager(self.arr_categories, self) self.managed_objects["FreeSpaceManager"] = managed_object for cat in self.special_categories: