From 431e5513b89475e5493e042378471c196af5ad77 Mon Sep 17 00:00:00 2001 From: Feramance Date: Fri, 15 Nov 2024 10:01:00 +0100 Subject: [PATCH] Headless mode fix and limited qbittorrent version --- README.md | 1 + qBitrr/arss.py | 10 +++++++--- qBitrr/main.py | 8 +++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0911c997..d590a279 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ I am starting development on qBitrr+ which will be C# based for better overall p Some things to know before using it. +- **Latest supported qbittorrent version is 4.6.7** - qBittorrent >= 4.5.x - [Sonarr](https://github.com/Sonarr/Sonarr) and [Radarr](https://github.com/Radarr/Radarr) both setup to add tags to all downloads. - qBit set to create sub-folders for tag. diff --git a/qBitrr/arss.py b/qBitrr/arss.py index b411978d..a4fea427 100755 --- a/qBitrr/arss.py +++ b/qBitrr/arss.py @@ -106,7 +106,7 @@ def __init__( fh = logging.FileHandler(logfile) self.logger.addHandler(fh) run_logs(self.logger) - + if not QBIT_DISABLED: categories = self.manager.qbit_manager.client.torrent_categories.categories try: @@ -121,11 +121,15 @@ def __init__( self.category ) except KeyError: - self.completed_folder = pathlib.Path(COMPLETED_DOWNLOAD_FOLDER).joinpath(self.category) + self.completed_folder = pathlib.Path(COMPLETED_DOWNLOAD_FOLDER).joinpath( + self.category + ) self.manager.qbit_manager.client.torrent_categories.create_category( self.category, save_path=self.completed_folder ) - + else: + self.completed_folder = pathlib.Path(COMPLETED_DOWNLOAD_FOLDER).joinpath(self.category) + if not self.completed_folder.exists() and not SEARCH_ONLY: try: self.completed_folder.mkdir(parents=True, exist_ok=True) diff --git a/qBitrr/main.py b/qBitrr/main.py index eb8905fd..354b604a 100644 --- a/qBitrr/main.py +++ b/qBitrr/main.py @@ -59,7 +59,7 @@ class qBitManager: min_supported_version = VersionClass("4.3.9") soft_not_supported_supported_version = VersionClass("4.4.4") - # max_supported_version = VersionClass("4.6.2") + max_supported_version = VersionClass("4.6.7") _head_less_mode = False def __init__(self): @@ -127,9 +127,7 @@ def __init__(self): run_logs(self.logger) def _version_validator(self): - if ( - self.min_supported_version <= self.current_qbit_version - ): # <= self.max_supported_version): + if self.min_supported_version <= self.current_qbit_version <= self.max_supported_version: if self._validated_version: self.logger.info( "Current qBitTorrent version is supported: %s", self.current_qbit_version @@ -146,7 +144,7 @@ def _version_validator(self): "Supported version range is %s to < %s", self.current_qbit_version, self.min_supported_version, - # self.max_supported_version, + self.max_supported_version, ) sys.exit(1)