From 15075cac07627d03606412b41ae571348b13fad1 Mon Sep 17 00:00:00 2001 From: bobokun Date: Fri, 7 Jan 2022 15:38:06 -0500 Subject: [PATCH] check compatibility only on major release versions --- modules/qbittorrent.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/qbittorrent.py b/modules/qbittorrent.py index 4c90b10..c365d73 100644 --- a/modules/qbittorrent.py +++ b/modules/qbittorrent.py @@ -11,7 +11,7 @@ logger = logging.getLogger("qBit Manage") class Qbt: - SUPPORTED_VERSION = 'v4.3.9' + SUPPORTED_VERSION = 'v4.3' def __init__(self, config, params): self.config = config @@ -26,8 +26,9 @@ class Qbt: logger.debug(f'qBittorrent: {self.client.app.version}') logger.debug(f'qBittorrent Web API: {self.client.app.web_api_version}') logger.debug(f'qbit_manage support version: {self.SUPPORTED_VERSION}') - if self.client.app.version > self.SUPPORTED_VERSION: - e = f"Qbittorrent Error: qbit_manage is only comaptible with {self.SUPPORTED_VERSION} or lower. You are currently on {self.client.app.version}" + current_version = ".".join(self.client.app.version.split(".")[:2]) + if current_version > self.SUPPORTED_VERSION: + e = f"Qbittorrent Error: qbit_manage is only comaptible with {self.SUPPORTED_VERSION}.* or lower. You are currently on {self.client.app.version}" self.config.notify(e, "Qbittorrent") print_line(e, 'CRITICAL') sys.exit(0)