From 114c158299a0519bf84cb290bc254ad8d49c89eb Mon Sep 17 00:00:00 2001 From: Feramance Date: Mon, 1 Jul 2024 15:24:39 +0200 Subject: [PATCH] Free space adjustment --- qBitrr/arss.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/qBitrr/arss.py b/qBitrr/arss.py index d3a7eca0..5d5d108d 100755 --- a/qBitrr/arss.py +++ b/qBitrr/arss.py @@ -5133,13 +5133,21 @@ def _process_single_torrent(self, torrent): free_space_test = self.current_free_space free_space_test -= torrent["amount_left"] self.logger.trace( - "Resulting free space: %s -> %s", self.current_free_space, free_space_test + "Result[%s]: Free space %s -> %s", + torrent.name, + self.current_free_space, + free_space_test, ) if ( torrent.state_enum != TorrentStates.PAUSED_DOWNLOAD and self.current_free_space < torrent["amount_left"] ): - self.logger.trace("Pause download: Free space %s", self.current_free_space) + self.logger.trace( + "Pause download[%s]: Free space %s -> %s", + torrent.name, + self.current_free_space, + free_space_test, + ) torrent.add_tags(tags=["qBitrr-free_space_paused"]) torrent.remove_tags(tags=["qBitrr-allowed_seeding"]) self._process_single_torrent_pause_disk_space(torrent) @@ -5149,14 +5157,25 @@ def _process_single_torrent(self, torrent): ): self.current_free_space = free_space_test self.logger.trace( - "Can download: Free space %s -> %s", self.current_free_space, free_space_test + "Can download[%s]: Free space %s -> %s", + torrent.name, + self.current_free_space, + free_space_test, ) torrent.remove_tags(tags=["qBitrr-free_space_paused"]) + else: + self.current_free_space = free_space_test + self.logger.trace( + "Downloading[%s]: Free space %s -> %s", + torrent.name, + self.current_free_space, + free_space_test, + ) elif not self.is_downloading_state(torrent) and "qBitrr-free_space_paused" in torrent.tags: self.logger.trace( "Removing tag[%s] for completed torrent[%s]: Free space %s", "qBitrr-free_space_paused", - torrent, + torrent.name, self.current_free_space, ) torrent.remove_tags(tags=["qBitrr-free_space_paused"])