check compatibility only on major release versions

This commit is contained in:
bobokun 2022-01-07 15:38:06 -05:00
parent 9ea244d426
commit 15075cac07
No known key found for this signature in database
GPG key ID: 9665BA6CF5DC2671

View file

@ -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)