批量生成视频

This commit is contained in:
小帅 2026-04-01 22:44:26 +08:00
parent 57ab0905b2
commit ae36362a39
3 changed files with 24 additions and 39 deletions

View File

@ -19,6 +19,7 @@ export default router.post(
.select("o_assets.*", "o_image.filePath", "o_image.state", "o_image.model", "o_image.resolution", "o_image.errorReason") .select("o_assets.*", "o_image.filePath", "o_image.state", "o_image.model", "o_image.resolution", "o_image.errorReason")
.where("o_assets.projectId", projectId) .where("o_assets.projectId", projectId)
.andWhere("o_assets.type", "<>", "clip") .andWhere("o_assets.type", "<>", "clip")
.andWhere("o_assets.assetsId", null)
.modify((qb) => { .modify((qb) => {
if (type && type.length > 0) qb.whereIn("o_assets.type", type); if (type && type.length > 0) qb.whereIn("o_assets.type", type);
}) })

View File

@ -25,7 +25,7 @@ export default router.post(
uploadData: z.array( uploadData: z.array(
z.object({ z.object({
id: z.number(), id: z.number(),
type: z.string(), sources: z.string(),
}), }),
), ),
prompt: z.string(), prompt: z.string(),
@ -37,7 +37,7 @@ export default router.post(
trackId: z.number(), trackId: z.number(),
}), }),
async (req, res) => { async (req, res) => {
const { scriptId, projectId, prompt, uploadData, model, duration, resolution, audio, mode, trackId } = req.body; const { scriptId, projectId, prompt, uploadData, model, duration, resolution, audio, mode, trackId } = req.body;
//获取生成视频比例 //获取生成视频比例
const ratio = await u.db("o_project").select("videoRatio").where("id", projectId).first(); const ratio = await u.db("o_project").select("videoRatio").where("id", projectId).first();
const videoPath = `/${projectId}/video/${uuidv4()}.mp4`; //视频保存路径 const videoPath = `/${projectId}/video/${uuidv4()}.mp4`; //视频保存路径

View File

@ -1,40 +1,23 @@
// @db-hash 54f96fd4840bc7be938137276359fa34 // @db-hash 6a348d086c2b17da9a5120ad4f89f068
//该文件由脚本自动生成,请勿手动修改 //该文件由脚本自动生成,请勿手动修改
export interface _o_assets_old_20260401 { export interface _o_vendorConfig_old_20260401 {
'assetsId'?: number | null; 'author'?: string | null;
'describe'?: string | null; 'code'?: string | null;
'id'?: number; 'createTime'?: number | null;
'imageId'?: number | null; 'description'?: string | null;
'icon'?: string | null;
'id'?: string;
'inputs'?: string | null;
'inputValues'?: string | null;
'models'?: string | null;
'name'?: string | null; 'name'?: string | null;
}
export interface _o_videoTrack_old_20260401 {
'id'?: number;
'projectId'?: number | null; 'projectId'?: number | null;
'prompt'?: string | null;
'promptState'?: string | null;
'remark'?: string | null;
'scriptId'?: number | null; 'scriptId'?: number | null;
'startTime'?: number | null; 'videoId'?: number | null;
'type'?: string | null;
}
export interface _o_image_old_20260401 {
'assetsId'?: number | null;
'filePath'?: string | null;
'id'?: number;
'model'?: string | null;
'reason'?: string | null;
'resolution'?: string | null;
'state'?: string | null;
'type'?: string | null;
}
export interface _o_image_old_20260401_1 {
'assetsId'?: number | null;
'errorReason'?: string | null;
'filePath'?: string | null;
'id'?: number;
'model'?: string | null;
'reason'?: string | null;
'resolution'?: string | null;
'state'?: string | null;
'type'?: string | null;
} }
export interface memories { export interface memories {
'content': string; 'content': string;
@ -77,6 +60,7 @@ export interface o_artStyle {
export interface o_assets { export interface o_assets {
'assetsId'?: number | null; 'assetsId'?: number | null;
'describe'?: string | null; 'describe'?: string | null;
'flowId'?: number | null;
'id'?: number; 'id'?: number;
'imageId'?: number | null; 'imageId'?: number | null;
'name'?: string | null; 'name'?: string | null;
@ -106,6 +90,7 @@ export interface o_eventChapter {
} }
export interface o_image { export interface o_image {
'assetsId'?: number | null; 'assetsId'?: number | null;
'errorReason'?: string | null;
'filePath'?: string | null; 'filePath'?: string | null;
'id'?: number; 'id'?: number;
'model'?: string | null; 'model'?: string | null;
@ -115,10 +100,8 @@ export interface o_image {
'type'?: string | null; 'type'?: string | null;
} }
export interface o_imageFlow { export interface o_imageFlow {
'assetsId'?: number | null;
'flowData': string; 'flowData': string;
'id'?: number; 'id'?: number;
'storyboardId'?: number | null;
} }
export interface o_novel { export interface o_novel {
'chapter'?: string | null; 'chapter'?: string | null;
@ -150,6 +133,7 @@ export interface o_project {
'imageModel'?: string | null; 'imageModel'?: string | null;
'imageQuality'?: string | null; 'imageQuality'?: string | null;
'intro'?: string | null; 'intro'?: string | null;
'mode'?: string | null;
'name'?: string | null; 'name'?: string | null;
'projectType'?: string | null; 'projectType'?: string | null;
'type'?: string | null; 'type'?: string | null;
@ -231,6 +215,7 @@ export interface o_vendorConfig {
'code'?: string | null; 'code'?: string | null;
'createTime'?: number | null; 'createTime'?: number | null;
'description'?: string | null; 'description'?: string | null;
'enableEnglish'?: number | null;
'icon'?: string | null; 'icon'?: string | null;
'id'?: string; 'id'?: string;
'inputs'?: string | null; 'inputs'?: string | null;
@ -260,9 +245,8 @@ export interface o_videoTrack {
} }
export interface DB { export interface DB {
"_o_assets_old_20260401": _o_assets_old_20260401; "_o_vendorConfig_old_20260401": _o_vendorConfig_old_20260401;
"_o_image_old_20260401": _o_image_old_20260401; "_o_videoTrack_old_20260401": _o_videoTrack_old_20260401;
"_o_image_old_20260401_1": _o_image_old_20260401_1;
"memories": memories; "memories": memories;
"o_agentDeploy": o_agentDeploy; "o_agentDeploy": o_agentDeploy;
"o_agentWorkData": o_agentWorkData; "o_agentWorkData": o_agentWorkData;