From c7ff15d65dd3a5bff1ece97be0b7a88265d0a640 Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Thu, 2 Apr 2026 19:59:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=88=86=E9=95=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/production/storyboard/addStoryboard.ts | 2 +- .../production/storyboard/batchGenerateImage.ts | 13 +++++++++---- .../production/storyboard/updateStoryboardUrl.ts | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/routes/production/storyboard/addStoryboard.ts b/src/routes/production/storyboard/addStoryboard.ts index 0aa9e7a..54aebf1 100644 --- a/src/routes/production/storyboard/addStoryboard.ts +++ b/src/routes/production/storyboard/addStoryboard.ts @@ -38,7 +38,7 @@ export default router.post( filePath: new URL(src).pathname, trackId, videoDesc, - shouldGenerateImage, + shouldGenerateImage: src ? 1 : 0, scriptId: scriptId, projectId: projectId, }); diff --git a/src/routes/production/storyboard/batchGenerateImage.ts b/src/routes/production/storyboard/batchGenerateImage.ts index a47ef8c..057b6d2 100644 --- a/src/routes/production/storyboard/batchGenerateImage.ts +++ b/src/routes/production/storyboard/batchGenerateImage.ts @@ -33,7 +33,9 @@ export default router.post( if (!storyboardIds || storyboardIds.length === 0) return res.status(400).send(error("storyboardIds不能为空")); // 当没有 storyboardIds 时,通过 AI 生成新的分镜面板数据 let finalStoryboardIds: number[] = storyboardIds || []; - await u.db("o_storyboard").whereIn("id", finalStoryboardIds).where("scriptId", scriptId).update({ state: "生成中" }); + // shouldGenerateImage === 0 的分镜标记为「未生成」,其余标记为「生成中」 + await u.db("o_storyboard").whereIn("id", finalStoryboardIds).where("scriptId", scriptId).where("shouldGenerateImage", 0).update({ state: "未生成" }); + await u.db("o_storyboard").whereIn("id", finalStoryboardIds).where("scriptId", scriptId).whereNot("shouldGenerateImage", 0).update({ state: "生成中" }); const projectSettingData = await u.db("o_project").where("id", projectId).select("imageModel", "imageQuality", "artStyle").first(); @@ -61,6 +63,8 @@ export default router.post( associateAssetsIds: assetRecord[i.id!], src: null, state: i.state, + videoDesc: i.videoDesc, + shouldGenerateImage: i.shouldGenerateImage, })), ), ); @@ -103,9 +107,10 @@ export default router.post( }); }; - // 按 concurrentCount 控制并发数,分批执行 - for (let i = 0; i < storyboardData.length; i += concurrentCount) { - const batch = storyboardData.slice(i, i + concurrentCount); + // 按 concurrentCount 控制并发数,分批执行;跳过 shouldGenerateImage === 0 的分镜 + const generateList = storyboardData.filter((item) => item.shouldGenerateImage !== 0); + for (let i = 0; i < generateList.length; i += concurrentCount) { + const batch = generateList.slice(i, i + concurrentCount); await Promise.all(batch.map(generateTask)); } }, diff --git a/src/routes/production/storyboard/updateStoryboardUrl.ts b/src/routes/production/storyboard/updateStoryboardUrl.ts index 95294f9..708f43f 100644 --- a/src/routes/production/storyboard/updateStoryboardUrl.ts +++ b/src/routes/production/storyboard/updateStoryboardUrl.ts @@ -22,6 +22,7 @@ export default router.post( filePath: new URL(url).pathname, flowId, state: "已完成", + shouldGenerateImage:url ? 1 : 0 }); res.status(200).send(success({ message: "更新分镜成功" })); }, From eec2dc88cc107502e6bebec43c3083b77678f3e0 Mon Sep 17 00:00:00 2001 From: zhishi <1951671751@qq.com> Date: Thu, 2 Apr 2026 20:07:01 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AFbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/types/database.d.ts | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 62a13d9..a8c2754 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,21 +1,6 @@ -// @db-hash 35cf00f711e9d4df398703de70511684 +// @db-hash 7af86e2bafe5cab7d175eb68cf76ed7a //该文件由脚本自动生成,请勿手动修改 -export interface _o_project_old_20260402 { - 'artStyle'?: string | null; - 'createTime'?: number | null; - 'id'?: number | null; - 'imageModel'?: string | null; - 'imageQuality'?: string | null; - 'intro'?: string | null; - 'mode'?: string | null; - 'name'?: string | null; - 'projectType'?: string | null; - 'type'?: string | null; - 'userId'?: number | null; - 'videoModel'?: string | null; - 'videoRatio'?: string | null; -} export interface _o_storyboard_old_20260402 { 'createTime'?: number | null; 'duration'?: string | null; @@ -180,7 +165,6 @@ export interface o_outlineNovel { export interface o_project { 'artStyle'?: string | null; 'createTime'?: number | null; - 'directorManual'?: string | null; 'id'?: number | null; 'imageModel'?: string | null; 'imageQuality'?: string | null; @@ -301,7 +285,6 @@ export interface o_videoTrack { } export interface DB { - "_o_project_old_20260402": _o_project_old_20260402; "_o_storyboard_old_20260402": _o_storyboard_old_20260402; "_o_storyboard_old_20260402_1": _o_storyboard_old_20260402_1; "_o_vendorConfig_old_20260401": _o_vendorConfig_old_20260401;