修复bug
This commit is contained in:
parent
f2e1770533
commit
f635063ec3
@ -86,6 +86,7 @@ export default router.post(
|
|||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
const storyboardData = await u.db("o_storyboard").where("scriptId", episodesId);
|
const storyboardData = await u.db("o_storyboard").where("scriptId", episodesId);
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
storyboardData.map(async (i) => {
|
storyboardData.map(async (i) => {
|
||||||
if (i.filePath) {
|
if (i.filePath) {
|
||||||
|
|||||||
@ -25,16 +25,23 @@ export default router.post(
|
|||||||
} = req.body;
|
} = req.body;
|
||||||
const sqlData = await u.db("o_agentWorkData").where("projectId", String(projectId)).andWhere("episodesId", String(episodesId)).first();
|
const sqlData = await u.db("o_agentWorkData").where("projectId", String(projectId)).andWhere("episodesId", String(episodesId)).first();
|
||||||
const filterDatas = data.storyboard.filter((i) => !i.id);
|
const filterDatas = data.storyboard.filter((i) => !i.id);
|
||||||
if (data.storyboard && data.storyboard.length && !filterDatas.length)
|
if (data.storyboard && data.storyboard.length && !filterDatas.length) {
|
||||||
await Promise.all(
|
try {
|
||||||
data.storyboard
|
await Promise.all(
|
||||||
.filter((i) => i.id)
|
data.storyboard
|
||||||
.map(async (i, index) => {
|
.filter((i) => i.id)
|
||||||
await u.db("o_storyboard").where("id", i.id).update({
|
.map(async (i, index) => {
|
||||||
index: index,
|
await u.db("o_storyboard").where("id", i.id).update({
|
||||||
});
|
index: index,
|
||||||
}),
|
});
|
||||||
);
|
}),
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("更新分镜排序失败", error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!sqlData) {
|
if (!sqlData) {
|
||||||
await u.db("o_agentWorkData").insert({
|
await u.db("o_agentWorkData").insert({
|
||||||
projectId,
|
projectId,
|
||||||
|
|||||||
@ -32,9 +32,9 @@ export default router.post(
|
|||||||
state: item.state,
|
state: item.state,
|
||||||
scriptId,
|
scriptId,
|
||||||
projectId,
|
projectId,
|
||||||
track:item.track,
|
track: item.track,
|
||||||
videoDesc:item.videoDesc,
|
videoDesc: item.videoDesc,
|
||||||
shouldGenerateImage:item.shouldGenerateImage,
|
shouldGenerateImage: item.shouldGenerateImage,
|
||||||
createTime: Date.now(),
|
createTime: Date.now(),
|
||||||
});
|
});
|
||||||
if (item.associateAssetsIds?.length) {
|
if (item.associateAssetsIds?.length) {
|
||||||
@ -100,6 +100,7 @@ export default router.post(
|
|||||||
state: i.state,
|
state: i.state,
|
||||||
scriptId: i.scriptId,
|
scriptId: i.scriptId,
|
||||||
reason: i.reason,
|
reason: i.reason,
|
||||||
|
videoDesc: i.videoDesc
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user