From 0aa33d590c1e701a8f9369fb4678e9d8baf8bb75 Mon Sep 17 00:00:00 2001 From: thzxx Date: Thu, 18 Jun 2026 13:23:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=5FvideoFrames=20=E6=94=B9=E7=94=A8=20al?= =?UTF-8?q?lVids=20=E6=80=BB=E5=B8=A7=E6=95=B0=EF=BC=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=A4=9A=E4=B8=AA=E8=A7=86=E9=A2=91=E6=97=B6=E6=8C=87=E7=A4=BA?= =?UTF-8?q?=E7=89=8C=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/components/input-area.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/renderer/components/input-area.ts b/src/renderer/components/input-area.ts index 5c54550..a72c4bf 100644 --- a/src/renderer/components/input-area.ts +++ b/src/renderer/components/input-area.ts @@ -1002,8 +1002,8 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio const displayContent = displayParts.join('\n'); // Ollama API 用的完整描述(视频带帧序列) + let allVids: Array<{ name: string; count: number; dur: number; frames: Array<{ timestampSeconds: number; name: string }> }> = []; if (hasVideos) { - const allVids: Array<{ name: string; count: number; dur: number; frames: Array<{ timestampSeconds: number; name: string }> }> = []; if (pendingVideoMeta && pendingVideoFrames.length > 0) { allVids.push({ name: pendingVideoMeta.fileName, count: pendingVideoFrames.length, dur: pendingVideoMeta.duration, frames: pendingVideoFrames }); } @@ -1029,9 +1029,10 @@ async function sendMessageWithAgentLoop(text: string, currentSession: ChatSessio images: [...pendingImages.map(img => img.base64)], timestamp: now }; - if (pendingVideoFrames.length > 0 && pendingVideoMeta) { - msg._videoFrames = [...pendingVideoFrames]; - msg._videoMeta = { ...pendingVideoMeta, frameCount: pendingVideoFrames.length }; + if (allVids.length > 0) { + const totalFrames = allVids.flatMap(v => v.frames); + msg._videoFrames = totalFrames; + msg._videoMeta = { fileName: allVids[0].name, duration: allVids[0].dur, frameCount: totalFrames.length }; } if (userFiles.length > 0) { msg.files = userFiles;