修复bug

This commit is contained in:
zhishi 2026-04-15 19:14:49 +08:00
parent 4ef9060b97
commit 9c2694f842
6 changed files with 12 additions and 10 deletions

View File

@ -26,8 +26,9 @@ export default router.post(
}),
async (req, res) => {
const { prompt, duration, state, src, scriptId, projectId, videoDesc, shouldGenerateImage } = req.body;
const [trackId] = await u.db("o_videoTrack").insert({
const trackId = Date.now()
await u.db("o_videoTrack").insert({
id: trackId,
scriptId: scriptId,
projectId,
});

View File

@ -77,7 +77,9 @@ export default router.post(
await u.db("o_videoTrack").where("id", trackId).update({ duration: trackDuration });
} else {
// 不存在新建videoTrack
const [newTrackId] = await u.db("o_videoTrack").insert({
const newTrackId = Date.now()
await u.db("o_videoTrack").insert({
id: newTrackId,
scriptId,
projectId,
duration: trackDuration,

View File

@ -16,11 +16,13 @@ export default router.post(
const data = await u.db("o_project").where("id", projectId).first();
const video = data?.videoModel?.split(":");
const vemdor = await u.vendor.getModelList(video?.[0]!);
const [id] = await u.db("o_videoTrack").insert({
const trackId = Date.now()
await u.db("o_videoTrack").insert({
id: trackId,
projectId,
scriptId,
duration,
});
res.status(200).send(success(id));
res.status(200).send(success(trackId));
},
);

View File

@ -16,7 +16,6 @@ export default router.post(
}),
async (req, res) => {
const { name, content, projectId, assets } = req.body;
if (content.length >= 3000) return res.status(400).send(error("内容不能超过3000字"));
const [scriptId] = await u.db("o_script").insert({
name,
content,

View File

@ -134,7 +134,7 @@ export default router.post(
const uniqueRows = [
...new Map(scriptAssetRows.map((r) => [`${r.scriptId}_${r.assetId}`, r])).values(),
];
console.log("%c Line:135 🥝 uniqueRows", "background:#7f2b82", uniqueRows);
// 先删除本批 scriptId 的旧关联,再插入新的
await u.db("o_scriptAssets").whereIn("scriptId", batchScriptIds).delete();
@ -197,7 +197,7 @@ export default router.post(
.describe("已有资产的引用列表(在已有资产列表中已存在的),只需给出资产名称和使用该资产的 scriptIds"),
}),
execute: async ({ newAssets, existingAssetRefs }) => {
console.log("[tools] extractAssets result", { newAssets, existingAssetRefs });
if (newAssets?.length) collectedNew = newAssets;
if (existingAssetRefs?.length) collectedExisting = existingAssetRefs;
return "无需回复用户任何内容";

View File

@ -16,8 +16,6 @@ export default router.post(
}),
async (req, res) => {
const { id, name, content, assets } = req.body;
if (content.length >= 3000) return res.status(400).send(error("内容不能超过3000字"));
await u.db("o_script").where({ id }).update({
name,
content,