From 83f21b248d7543656a5e887a3d9825a8970d03bf Mon Sep 17 00:00:00 2001 From: dev Date: Wed, 24 Jun 2026 13:05:25 +0200 Subject: [PATCH] fix(quarantine): manager-tab approve immediately marks task completed When approving from the quarantine manager (no task_id in request), the re-import ran through the simple pipeline path with no task to update, so the downloads list stayed on 'failed' until the batch drained. Scan download_tasks for the task whose quarantine_entry_id matches the approved entry. If found, re-run through the verification wrapper with that task_id so the task is marked completed immediately in the live downloads list. Co-Authored-By: Claude Sonnet 4.6 --- web_server.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/web_server.py b/web_server.py index c3287168..55e4b64e 100644 --- a/web_server.py +++ b/web_server.py @@ -7640,6 +7640,17 @@ def approve_quarantine_item(entry_id): _t = download_tasks.get(_task_id) if isinstance(_t, dict): _batch_id = _t.get('batch_id') + else: + # Manager-tab approve: no task_id in the request. Find the task that + # owns this quarantine entry so the re-import marks it completed in + # the downloads list without waiting for the batch to finish. + with tasks_lock: + for _tid, _t in download_tasks.items(): + if isinstance(_t, dict) and _t.get('quarantine_entry_id') == entry_id: + _task_id = _tid + _batch_id = _t.get('batch_id') + break + if _task_id: context['task_id'] = _task_id if _batch_id: context['batch_id'] = _batch_id