Skip to content

Commit

Permalink
Headless mode fix and limited qbittorrent version
Browse files Browse the repository at this point in the history
  • Loading branch information
Feramance committed Nov 15, 2024
1 parent 358f1fe commit 431e551
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 7 additions & 3 deletions qBitrr/arss.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down
8 changes: 3 additions & 5 deletions qBitrr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 431e551

Please sign in to comment.