diff --git a/src/routes/production/storyboard/batchGenerateImage.ts b/src/routes/production/storyboard/batchGenerateImage.ts index a052d2e..203fc3f 100644 --- a/src/routes/production/storyboard/batchGenerateImage.ts +++ b/src/routes/production/storyboard/batchGenerateImage.ts @@ -44,7 +44,7 @@ export default router.post( .db("o_storyboard") .whereIn("id", finalStoryboardIds) .where("scriptId", scriptId) - .whereNot("shouldGenerateImage", 0) + .whereNot("shouldGenerateImage", 1) .update({ state: "生成中" }); const projectSettingData = await u.db("o_project").where("id", projectId).select("imageModel", "imageQuality", "artStyle", "videoRatio").first(); diff --git a/src/routes/production/storyboard/removeFrame.ts b/src/routes/production/storyboard/removeFrame.ts index 55d4483..74250fe 100644 --- a/src/routes/production/storyboard/removeFrame.ts +++ b/src/routes/production/storyboard/removeFrame.ts @@ -1,7 +1,7 @@ import express from "express"; import u from "@/utils"; import { z } from "zod"; -import { success } from "@/lib/responseFormat"; +import { error, success } from "@/lib/responseFormat"; import { validateFields } from "@/middleware/middleware"; const router = express.Router(); @@ -12,6 +12,10 @@ export default router.post( }), async (req, res) => { const { id } = req.body; + const storyboardData = await u.db("o_storyboard").where("id", id).select("id", "track", "trackId").first(); + if (!storyboardData) return res.status(400).send(error("未找到该分镜")); + const trackData = await u.db("o_storyboard").where("track", storyboardData.track).select("id"); + if (trackData.length == 1) await u.db("o_videoTrack").where("id", storyboardData.trackId).delete(); await u.db("o_storyboard").where("id", id).delete(); await u.db("o_assets2Storyboard").where("storyboardId", id).delete(); res.status(200).send(success({ message: "视频删除成功" }));