From f635063ec3c07fd475c59f1a24199ca9376ddeab Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Tue, 14 Apr 2026 16:31:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/production/getFlowData.ts | 1 + src/routes/production/saveFlowData.ts | 27 ++++++++++++------- .../storyboard/batchAddStoryboardInfo.ts | 7 ++--- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/routes/production/getFlowData.ts b/src/routes/production/getFlowData.ts index 15a1155..0de1f22 100644 --- a/src/routes/production/getFlowData.ts +++ b/src/routes/production/getFlowData.ts @@ -86,6 +86,7 @@ export default router.post( } else { try { const storyboardData = await u.db("o_storyboard").where("scriptId", episodesId); + await Promise.all( storyboardData.map(async (i) => { if (i.filePath) { diff --git a/src/routes/production/saveFlowData.ts b/src/routes/production/saveFlowData.ts index c48dcb4..c8773eb 100644 --- a/src/routes/production/saveFlowData.ts +++ b/src/routes/production/saveFlowData.ts @@ -25,16 +25,23 @@ export default router.post( } = req.body; const sqlData = await u.db("o_agentWorkData").where("projectId", String(projectId)).andWhere("episodesId", String(episodesId)).first(); const filterDatas = data.storyboard.filter((i) => !i.id); - if (data.storyboard && data.storyboard.length && !filterDatas.length) - await Promise.all( - data.storyboard - .filter((i) => i.id) - .map(async (i, index) => { - await u.db("o_storyboard").where("id", i.id).update({ - index: index, - }); - }), - ); + if (data.storyboard && data.storyboard.length && !filterDatas.length) { + try { + await Promise.all( + data.storyboard + .filter((i) => i.id) + .map(async (i, index) => { + await u.db("o_storyboard").where("id", i.id).update({ + index: index, + }); + }), + ); + } catch (error) { + console.error("更新分镜排序失败", error) + } + } + + if (!sqlData) { await u.db("o_agentWorkData").insert({ projectId, diff --git a/src/routes/production/storyboard/batchAddStoryboardInfo.ts b/src/routes/production/storyboard/batchAddStoryboardInfo.ts index 56f334b..7af2e3e 100644 --- a/src/routes/production/storyboard/batchAddStoryboardInfo.ts +++ b/src/routes/production/storyboard/batchAddStoryboardInfo.ts @@ -32,9 +32,9 @@ export default router.post( state: item.state, scriptId, projectId, - track:item.track, - videoDesc:item.videoDesc, - shouldGenerateImage:item.shouldGenerateImage, + track: item.track, + videoDesc: item.videoDesc, + shouldGenerateImage: item.shouldGenerateImage, createTime: Date.now(), }); if (item.associateAssetsIds?.length) { @@ -100,6 +100,7 @@ export default router.post( state: i.state, scriptId: i.scriptId, reason: i.reason, + videoDesc: i.videoDesc }; }), );