From dee269aeda676adabb58d3615f8f0bf692e6d289 Mon Sep 17 00:00:00 2001 From: seaislee1209 Date: Wed, 24 Jun 2026 00:56:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(script):=20=E8=84=9A=E6=9C=AC=E6=8C=89?= =?UTF-8?q?=E5=90=91=E5=AF=BC=E9=80=89=E7=9A=84=E6=88=90=E7=89=87=E6=97=B6?= =?UTF-8?q?=E9=95=BF=E7=94=9F=E6=88=90,=E4=B8=8D=E5=86=8D=E5=86=99?= =?UTF-8?q?=E6=AD=BB=2060=20=E7=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pipeline 调脚本 agent 时 total_duration 写死成 60,忽略了向导里选的时长(选 30s 也按 60s 出)。 改为从 project.metadata.wizard.duration("0-30"→30)解析后传入;缺省回落 60。 Co-Authored-By: Claude Opus 4.8 (1M context) --- core/frontend/src/routes/pipeline.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/frontend/src/routes/pipeline.tsx b/core/frontend/src/routes/pipeline.tsx index 6f4ff5a..df194d8 100644 --- a/core/frontend/src/routes/pipeline.tsx +++ b/core/frontend/src/routes/pipeline.tsx @@ -998,6 +998,12 @@ export function PipelinePage(props: { const [setupSource, setSetupSource] = useState<"ai" | "theme" | "manual">("ai"); const [setupStyle, setSetupStyle] = useState(project.metadata?.wizard?.script_style || SETUP_STYLE_KEYS[0] || "pain"); const [setupPersona, setSetupPersona] = useState(project.metadata?.wizard?.persona || SETUP_PERSONA_KEYS[0] || "urban"); + // 向导选的成片时长档("0-30"→30 秒)传给脚本 agent —— 脚本按它定镜数,别再写死 60(否则选 30s 也按 60s 出) + const wizardTotalDuration = (() => { + const raw = project.metadata?.wizard?.duration; + const m = /(\d+)\s*$/.exec(typeof raw === "string" ? raw : ""); + return m ? Number(m[1]) : 60; + })(); const chatTextareaRef = useRef(null); const chatFileRef = useRef(null); const chatBodyRef = useRef(null); @@ -1152,7 +1158,7 @@ export function PipelinePage(props: { model_config_id: activeScriptModelId || undefined, base_version_id: baseVersionId, aspect_ratio: "9:16", - total_duration: 60, + total_duration: wizardTotalDuration, target_index: targetIndex }, (evt) => {