Skip to content

Commit

Permalink
Added auto pause resume check for free space subprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Jul 3, 2024
1 parent 998ed1e commit 3b77664
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3b77664

Please sign in to comment.