From ddd4075bb87b1cf55e1fec9902803aa8ad0ee7f4 Mon Sep 17 00:00:00 2001 From: Anas Tayyar Date: Mon, 3 Jun 2024 12:18:52 +0300 Subject: [PATCH] Fix file selection confirmation --- bot/modules/file_selector.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bot/modules/file_selector.py b/bot/modules/file_selector.py index 5d1694050bc..6a81ee7b9b1 100644 --- a/bot/modules/file_selector.py +++ b/bot/modules/file_selector.py @@ -11,6 +11,8 @@ user_data, LOGGER, config_dict, + qbittorrent_client, + sabnzbd_client, ) from bot.helper.ext_utils.bot_utils import bt_selection_buttons, sync_to_async from bot.helper.ext_utils.status_utils import getTaskByGid, MirrorStatus @@ -117,10 +119,10 @@ async def get_confirm(_, query): if hasattr(task, "seeding"): if task.listener.isQbit: tor_info = ( - await sync_to_async(task.client.torrents_info, torrent_hash=id_) + await sync_to_async(qbittorrent_client.torrents_info, torrent_hash=id_) )[0] path = tor_info.content_path.rsplit("/", 1)[0] - res = await sync_to_async(task.client.torrents_files, torrent_hash=id_) + res = await sync_to_async(qbittorrent_client.torrents_files, torrent_hash=id_) for f in res: if f.priority == 0: f_paths = [f"{path}/{f.name}", f"{path}/{f.name}.!qB"] @@ -131,7 +133,7 @@ async def get_confirm(_, query): except: pass if not task.queued: - await sync_to_async(task.client.torrents_resume, torrent_hashes=id_) + await sync_to_async(qbittorrent_client.torrents_resume, torrent_hashes=id_) else: res = await sync_to_async(aria2.client.get_files, id_) for f in res: @@ -148,7 +150,7 @@ async def get_confirm(_, query): f"{e} Error in resume, this mostly happens after abuse aria2. Try to use select cmd again!" ) elif task.listener.isNzb: - await task.client.resume_job(id_) + await sabnzbd_client.resume_job(id_) await sendStatusMessage(message) await deleteMessage(message) else: