From 9e9112f7ef346dd454e7dd0deef9c739e5964f19 Mon Sep 17 00:00:00 2001 From: vkartk <53650724+vkartk@users.noreply.github.com> Date: Fri, 26 Jan 2024 11:06:54 +0530 Subject: [PATCH] Fix cancelling non-started downloads (#383) --- app/ytdl.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/ytdl.py b/app/ytdl.py index 8b05857..b8cb733 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -329,6 +329,10 @@ class DownloadQueue: async def cancel(self, ids): for id in ids: + if self.pending.exists(id): + self.pending.delete(id) + await self.notifier.canceled(id) + continue if not self.queue.exists(id): log.warn(f'requested cancel for non-existent download {id}') continue