From b8aad2ea6291f0cd0adb9a1c00c96d1c9f3be995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E9=B1=BC=E5=BC=80=E5=8F=91?= Date: Sat, 16 May 2026 14:38:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(points):=20=E8=A7=86=E9=A2=91=E7=94=9F?= =?UTF-8?q?=E6=88=90=E7=A7=AF=E5=88=86=E8=AE=A1=E7=AE=97=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=20actualDuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 预估积分计算优先使用 actualDuration(配音合成后的实际时长), 不再依赖脚本的 duration 预估字段,确保显示值与实际扣费一致。 --- tauri-app/src/pages/VideoGeneration/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tauri-app/src/pages/VideoGeneration/index.tsx b/tauri-app/src/pages/VideoGeneration/index.tsx index 2d27034..ead1b75 100644 --- a/tauri-app/src/pages/VideoGeneration/index.tsx +++ b/tauri-app/src/pages/VideoGeneration/index.tsx @@ -58,9 +58,14 @@ export default function VideoGeneration() { }); }, []); - // 视频生成预计积分(秒数向上取整 × multiplier 积分/秒,空镜+分镜都计) + // 视频生成积分(秒数向上取整 × multiplier 积分/秒,优先用 actualDuration) const estimatedVideoPoints = useMemo(() => { const totalDur = shots.reduce((sum, shot) => { + // 优先使用实际时长(配音合成后已更新) + if (shot.actualDuration && shot.actualDuration > 0) { + return sum + shot.actualDuration; + } + // 回退到脚本的预估时长 const durStr = typeof shot.duration === 'string' ? shot.duration : '5s'; return sum + parseFloat(durStr.replace(/[^0-9.]/g, '') || '0'); }, 0);