From a703c5fdc2af2a99388ba1b6b4dc1b0f356b60fc Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Sun, 31 May 2026 18:44:00 -0700 Subject: [PATCH] Quarantine: inline 'Approve' button also marks the row Completed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The actions-column Approve button (approveQuarantineFromDownloadRow) POSTed /approve without a task_id, so it took the inner-pipeline path and never marked the task completed — the row stayed 'Quarantined' even though the file imported. The chooser's Accept was already fixed; this brings the inline button in line: it now carries data-task-id and sends task_id, so the re-import runs through the verification wrapper and the row flips to Completed on success. --- webui/static/downloads.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webui/static/downloads.js b/webui/static/downloads.js index a158bc9e..98ac7bbd 100644 --- a/webui/static/downloads.js +++ b/webui/static/downloads.js @@ -3357,6 +3357,7 @@ async function downloadCandidate(taskId, candidate, trackName) { async function approveQuarantineFromDownloadRow(button) { const entryId = button?.dataset?.entryId || ''; + const taskId = button?.dataset?.taskId || ''; if (!entryId) { showToast('Open Quarantine to approve this file.', 'warning'); return; @@ -3374,7 +3375,11 @@ async function approveQuarantineFromDownloadRow(button) { button.disabled = true; button.textContent = 'Approving...'; try { - const response = await fetch(`/api/quarantine/${encodeURIComponent(entryId)}/approve`, { method: 'POST' }); + const response = await fetch(`/api/quarantine/${encodeURIComponent(entryId)}/approve`, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ task_id: taskId }), + }); const data = await response.json(); if (data.success) { showToast('Approved quarantined file. Re-running post-processing.', 'success'); @@ -3828,7 +3833,7 @@ function processModalStatusUpdate(playlistId, data) { } } else if (actionsEl && task.status === 'failed' && isQuarantinedTask && task.quarantine_entry_id) { const entryId = escapeHtml(task.quarantine_entry_id); - actionsEl.innerHTML = ``; + actionsEl.innerHTML = ``; const approveBtn = actionsEl.querySelector('.approve-quarantine-inline-btn'); if (approveBtn) { approveBtn.addEventListener('click', () => approveQuarantineFromDownloadRow(approveBtn));