From c405edb58a7257b3257def01bcc7e62320335094 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 17 Feb 2026 22:03:02 +0800 Subject: [PATCH] =?UTF-8?q?fix(video-splice):=20=E6=8B=BC=E6=8E=A5?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E4=B8=AD=E5=BB=B6=E5=90=8E=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=8D=A0=E4=BD=8D=E5=8D=A1=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/public/js/video.js | 18 +++++++++++++----- app/static/public/pages/video.html | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/static/public/js/video.js b/app/static/public/js/video.js index fbf09a5..924bd9a 100644 --- a/app/static/public/js/video.js +++ b/app/static/public/js/video.js @@ -2073,6 +2073,7 @@ authHeader, taskIds: [], placeholders: new Map(), + failedPlaceholders: new Set(), sources: new Set(), pendingRejects: new Set(), }; @@ -2132,10 +2133,7 @@ successCount += 1; } catch (singleErr) { if (item) { - const completed = String(item.dataset.completed || '0') === '1'; - if (!completed) { - removePreviewItem(item); - } + spliceRun.failedPlaceholders.add(item); } if (String(singleErr && singleErr.message || '') === 'edit_cancelled') { return; @@ -2148,11 +2146,21 @@ return; } const missItem = spliceRun.placeholders.get(taskId) || null; - if (missItem) removePreviewItem(missItem); + if (missItem) spliceRun.failedPlaceholders.add(missItem); }) ); await Promise.allSettled(waitTasks); await processChain; + if (spliceRun.failedPlaceholders && spliceRun.failedPlaceholders.size) { + spliceRun.failedPlaceholders.forEach((item) => { + if (!item) return; + const completed = String(item.dataset.completed || '0') === '1'; + if (!completed) { + removePreviewItem(item); + } + }); + spliceRun.failedPlaceholders.clear(); + } if (spliceRun.cancelled) { throw new Error('edit_cancelled'); diff --git a/app/static/public/pages/video.html b/app/static/public/pages/video.html index a7c275e..f9367eb 100644 --- a/app/static/public/pages/video.html +++ b/app/static/public/pages/video.html @@ -318,7 +318,7 @@ - +