Merge branch '108' of https://github.com/HBAI-Ltd/Toonflow-app into 108
# Conflicts: # src/router.ts # src/types/database.d.ts
This commit is contained in:
commit
d5430d257c
@ -33,6 +33,12 @@ export const storyboardSchema = z.object({
|
||||
prompt: z.string().describe("生成提示词"),
|
||||
lines: z.string().nullable().describe("台词内容"),
|
||||
sound: z.string().nullable().describe("音效内容"),
|
||||
mode: z
|
||||
.union([
|
||||
z.enum(["singleImage", "multiImage", "gridImage", "startEndRequired", "endFrameOptional", "startFrameOptional", "text"]),
|
||||
z.array(z.enum(["video", "image", "audio", "text"])),
|
||||
])
|
||||
.describe("视频模式"),
|
||||
associateAssetsIds: z.array(z.number()).describe("关联资产ID列表"),
|
||||
src: z.string().nullable().describe("分镜资源路径"),
|
||||
});
|
||||
|
||||
@ -88,7 +88,6 @@ export default router.post(
|
||||
} else {
|
||||
try {
|
||||
const storyboardData = await u.db("o_storyboard").where("scriptId", episodesId);
|
||||
console.log("%c Line:90 🍡 storyboardData", "background:#ed9ec7", storyboardData.length);
|
||||
await Promise.all(
|
||||
storyboardData.map(async (i) => {
|
||||
if (i.filePath) {
|
||||
@ -165,6 +164,7 @@ export default router.post(
|
||||
const buildStoryboardItem = (i: (typeof storyboardData)[number], existing: any = {}) => ({
|
||||
...existing,
|
||||
id: i.id,
|
||||
index: i.index,
|
||||
title: i.title,
|
||||
description: i.description,
|
||||
camera: i.camera,
|
||||
@ -199,8 +199,7 @@ export default router.post(
|
||||
orderedStoryboard.push(buildStoryboardItem(i));
|
||||
}
|
||||
});
|
||||
|
||||
flowData.storyboard = orderedStoryboard;
|
||||
flowData.storyboard = orderedStoryboard.sort((a, b) => (a.index ?? 0) - (b.index ?? 0));
|
||||
res.status(200).send(success(flowData));
|
||||
} catch (err) {
|
||||
res.status(400).send(error());
|
||||
|
||||
@ -13,7 +13,7 @@ export default router.post(
|
||||
const { scriptId } = req.body;
|
||||
|
||||
//查询分镜数据
|
||||
const storyboards = await u.db("o_storyboard").where("o_storyboard.scriptId", scriptId).select("*").orderBy("o_storyboard.createTime", "asc");
|
||||
const storyboards = await u.db("o_storyboard").where("o_storyboard.scriptId", scriptId).select("*").orderBy("index", "asc");
|
||||
|
||||
const storyboardsList = await Promise.all(
|
||||
storyboards.map(async (item) => {
|
||||
|
||||
@ -12,7 +12,7 @@ export default router.post(
|
||||
}),
|
||||
async (req, res) => {
|
||||
const { scriptId } = req.body;
|
||||
const storyboardData = await u.db("o_storyboard").where({ scriptId });
|
||||
const storyboardData = await u.db("o_storyboard").where({ scriptId }).orderBy("index", "asc");
|
||||
const data = await Promise.all(
|
||||
storyboardData.map(async (i) => {
|
||||
return {
|
||||
@ -83,7 +83,6 @@ export default router.post(
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
res.status(200).send(success(result));
|
||||
},
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user