From a050becc14057fc14203505c95a4c2f988938e3d Mon Sep 17 00:00:00 2001 From: Pengu Date: Wed, 10 Sep 2025 19:33:06 -0500 Subject: [PATCH] Fix qbit not disabling properly --- app.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/app.py b/app.py index 849e269..4e6c185 100644 --- a/app.py +++ b/app.py @@ -81,15 +81,23 @@ bot = commands.Bot(command_prefix=PREFIX, intents=intents, help_command=None) # QBITTORRENT SETUP # ===================== -qb = qbittorrentapi.Client( - host=QBIT_HOST, - username=QBIT_USERNAME, - password=QBIT_PASSWORD -) -try: - qb.auth_log_in() -except qbittorrentapi.LoginFailed: - print("Failed to log in to qBittorrent API") +if ENABLE_QBITTORRENT: + + qb = qbittorrentapi.Client( + host=QBIT_HOST, + username=QBIT_USERNAME, + password=QBIT_PASSWORD + ) + + try: + qb.auth_log_in() + print("✅ Logged in to qBittorrent") + except qbittorrentapi.LoginFailed: + print("❌ Failed to log in to qBittorrent API") + qb = None +else: + qb = None # qBittorrent disabled + # ===================== # DATABASE SETUP