mirror of
https://github.com/anasty17/mirror-leech-telegram-bot.git
synced 2025-01-08 12:07:33 +08:00
Minor fix for status
Signed-off-by: anasty17 <e.anastayyar@gmail.com>
This commit is contained in:
parent
3e1f623872
commit
c426fc8904
@ -53,7 +53,7 @@ STATUSES = {
|
||||
|
||||
async def getTaskByGid(gid: str):
|
||||
async with task_dict_lock:
|
||||
for tk in list(task_dict.values()):
|
||||
for tk in task_dict.values():
|
||||
if hasattr(tk, "seeding"):
|
||||
await sync_to_async(tk.update)
|
||||
if tk.gid() == gid:
|
||||
@ -65,28 +65,28 @@ def getSpecificTasks(status, userId):
|
||||
if status == "All":
|
||||
if userId:
|
||||
return [
|
||||
tk for tk in list(task_dict.values()) if tk.listener.userId == userId
|
||||
tk for tk in task_dict.values() if tk.listener.userId == userId
|
||||
]
|
||||
else:
|
||||
return list(task_dict.values())
|
||||
elif userId:
|
||||
return [
|
||||
tk
|
||||
for tk in list(task_dict.values())
|
||||
for tk in task_dict.values()
|
||||
if tk.listener.userId == userId
|
||||
and (
|
||||
(st := tk.status() == status)
|
||||
(st := tk.status()) and st == status
|
||||
or status == MirrorStatus.STATUS_DOWNLOADING
|
||||
and st not in list(STATUSES.values())
|
||||
and st not in STATUSES.values()
|
||||
)
|
||||
]
|
||||
else:
|
||||
return [
|
||||
tk
|
||||
for tk in list(task_dict.values())
|
||||
if (st := tk.status() == status)
|
||||
for tk in task_dict.values()
|
||||
if (st := tk.status()) and st == status
|
||||
or status == MirrorStatus.STATUS_DOWNLOADING
|
||||
and st not in list(STATUSES.values())
|
||||
and st not in STATUSES.values()
|
||||
]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user