diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index f99bc23..4ccbab2 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -493,6 +493,7 @@ description: 专注于从剧本内容中提取所使用的资产(角色、场 table.text("sound"); table.text("lines"); table.text("state"); + table.text("group"); table.text("reason"); table.integer("index"); table.integer("createTime"); diff --git a/src/routes/project/editVisualManual.ts b/src/routes/project/editVisualManual.ts index 6171620..73ab372 100644 --- a/src/routes/project/editVisualManual.ts +++ b/src/routes/project/editVisualManual.ts @@ -12,6 +12,7 @@ export default router.post( "/", validateFields({ name: z.string(), + title: z.string(), images: z.array(z.string()), data: z.array( z.object({ @@ -23,8 +24,9 @@ export default router.post( }), async (req, res) => { try { - const { name, images, data } = req.body as { + const { name, title, images, data } = req.body as { name: string; + title: string; images: string[]; data: { label: string; value: string; data: string }[]; }; @@ -72,7 +74,8 @@ export default router.post( if (!fs.existsSync(fileDir)) { fs.mkdirSync(fileDir, { recursive: true }); } - fs.writeFileSync(filePath, item.data, "utf-8"); + const content = item.value === "README" ? `# ${title}\n${item.data}` : item.data; + fs.writeFileSync(filePath, content, "utf-8"); } const ossImagesDir = u.getPath(["oss", name]); diff --git a/src/routes/script/extractAssets.ts b/src/routes/script/extractAssets.ts index 09e0fa5..008e0af 100644 --- a/src/routes/script/extractAssets.ts +++ b/src/routes/script/extractAssets.ts @@ -205,7 +205,7 @@ export default router.post( try { const data = await u.db("o_prompt").where("type", "scriptAssetExtraction").first("data"); const existingHint = existingAssetsList - ? `\n\n【已有资产列表】:${existingAssetsList}\n对于已有资产,如果在剧本中出现,只需在 existingAssetRefs 中给出资产名称和对应的 scriptIds 数组即可,无需重复生成 prompt/desc/type。对于新发现的资产(不在已有列表中),请在 newAssets 中给出完整信息。` + ? `\n\n【已有资产列表】:${existingAssetsList}\n对于已有资产,如果在剧本中出现,只需在 existingAssetRefs 中给出资产名称和对应的 scriptIds 数组即可,无需重复生成 desc/type。对于新发现的资产(不在已有列表中),请在 newAssets 中给出完整信息。` : ""; const output = await intansce.invoke({ diff --git a/src/types/database.d.ts b/src/types/database.d.ts index 2a3bc57..71424a0 100644 --- a/src/types/database.d.ts +++ b/src/types/database.d.ts @@ -1,4 +1,4 @@ -// @db-hash 93b2462070c45c2b449e9a18c4e88763 +// @db-hash d1fbadf1691063f5a730337685fd85b1 //该文件由脚本自动生成,请勿手动修改 export interface memories { @@ -73,6 +73,7 @@ export interface o_image { 'filePath'?: string | null; 'id'?: number; 'model'?: string | null; + 'reason'?: string | null; 'resolution'?: string | null; 'state'?: string | null; 'type'?: string | null; @@ -178,6 +179,7 @@ export interface o_storyboard { 'sound'?: string | null; 'state'?: string | null; 'title'?: string | null; + 'videoPrompt'?: string | null; } export interface o_tasks { 'describe'?: string | null; @@ -211,6 +213,7 @@ export interface o_video { 'errorReason'?: string | null; 'filePath'?: string | null; 'id'?: number; + 'projectId'?: number | null; 'scriptId'?: number | null; 'state'?: string | null; 'storyboardId'?: number | null;