diff --git a/api/DTO/movieEdit.ts b/api/DTO/movieEdit.ts index 28745c0..45690ec 100644 --- a/api/DTO/movieEdit.ts +++ b/api/DTO/movieEdit.ts @@ -363,6 +363,10 @@ export interface VideoFlowProjectResponse { last_message: string; /** 项目内容 */ data: ProjectContentData; + /** 最终简单视频 */ + final_simple_video: string; + /** 最终视频 */ + final_video: string; } /** * 新角色列表项接口 diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index ab3f6d2..a83c883 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -252,7 +252,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = loadingText.current = LOADING_TEXT_MAP.postProduction('AI-powered video editing in progress…'); } } - if (taskObject.currentStage === 'final_video') { + if (taskObject.currentStage === 'final_video' && taskObject.status !== 'COMPLETED') { loadingText.current = LOADING_TEXT_MAP.postProduction('generating fine-grained video clips...'); } if (taskObject.status === 'COMPLETED') { @@ -498,7 +498,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = throw new Error(response.message); } - const { status, data, tags, mode, original_text, title, name } = response.data; + const { status, data, tags, mode, original_text, title, name, final_simple_video, final_video } = response.data; const { current: taskCurrent } = tempTaskObject; @@ -611,6 +611,21 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = } } + // 粗剪 + if (final_simple_video) { + taskCurrent.currentStage = 'final_video'; + taskCurrent.final.url = final_simple_video; + taskCurrent.final.note = 'simple'; + taskCurrent.status = 'COMPLETED'; + } + + if (final_video) { + taskCurrent.currentStage = 'final_video'; + taskCurrent.final.url = final_video; + taskCurrent.final.note = 'final'; + taskCurrent.status = 'COMPLETED'; + } + console.log('---look-taskData', taskCurrent); if (taskCurrent.currentStage === 'script') { @@ -632,7 +647,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = }); // 设置是否需要获取流式数据 - setNeedStreamData(status !== 'COMPLETED'); + setNeedStreamData(taskCurrent.status !== 'COMPLETED'); } catch (error) { console.error('初始化失败:', error);