Skip to content

Commit

Permalink
Fix file selection confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
anasty17 authored Jun 3, 2024
1 parent 121e58d commit ddd4075
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bot/modules/file_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit ddd4075

Please sign in to comment.