From 0ea934c08f124a52fb4b69ef60b3e0a054afe041 Mon Sep 17 00:00:00 2001 From: rdiaz738 Date: Mon, 20 Apr 2026 17:24:16 -0700 Subject: [PATCH] Updated import and fixed race condition --- app/ytdl.py | 6 +++-- ui/src/app/app.html | 11 ++++++++ ui/src/app/app.ts | 62 ++++++++++++++++++++------------------------- 3 files changed, 43 insertions(+), 36 deletions(-) diff --git a/app/ytdl.py b/app/ytdl.py index 2738447..d6df963 100644 --- a/app/ytdl.py +++ b/app/ytdl.py @@ -1140,9 +1140,11 @@ class DownloadQueue: if not self.queue.exists(id): log.warning(f'requested cancel for non-existent download {id}') continue - if self.queue.get(id).started(): - self.queue.get(id).cancel() + dl = self.queue.get(id) + if dl.started(): + dl.cancel() else: + dl.canceled = True self.queue.delete(id) await self.notifier.canceled(id) return {'status': 'ok'} diff --git a/ui/src/app/app.html b/ui/src/app/app.html index 9ec0472..2b294fd 100644 --- a/ui/src/app/app.html +++ b/ui/src/app/app.html @@ -608,6 +608,17 @@ @if (batchImportStatus) { {{ batchImportStatus }} } + @if (importInProgress) { +
+
+ {{ batchImportCount }} / {{ batchImportTotal }} +
+
+ }