diff --git a/api/DTO/movieEdit.ts b/api/DTO/movieEdit.ts index 45654c9..0d92cca 100644 --- a/api/DTO/movieEdit.ts +++ b/api/DTO/movieEdit.ts @@ -680,10 +680,6 @@ export interface TaskObject { data: Scene[]; total_count: number; }; // 场景 - shot_sketch: { - data: ShotSketch[]; - total_count: number; - }; // 分镜草图 videos: { data: ShotVideo[]; total_count: number; diff --git a/components/pages/create-to-video2.tsx b/components/pages/create-to-video2.tsx index 09173f0..15e5bd9 100644 --- a/components/pages/create-to-video2.tsx +++ b/components/pages/create-to-video2.tsx @@ -206,7 +206,7 @@ export default function CreateToVideo2() {

- {project.name || "Unnamed"} + {/* {project.name || "Unnamed"} */}

diff --git a/components/pages/work-flow/media-viewer.tsx b/components/pages/work-flow/media-viewer.tsx index 9c9823e..6ce26eb 100644 --- a/components/pages/work-flow/media-viewer.tsx +++ b/components/pages/work-flow/media-viewer.tsx @@ -333,7 +333,7 @@ export const MediaViewer = React.memo(function MediaViewer({ {/* 操作按钮组 */} - + {/* handleEditClick('3', 'final')} /> - + */} {/* 视频信息浮层 */} {/* 背景模糊的图片 */} {taskObject.videos.data[currentSketchIndex].video_status !== 1 && ( -
+
{/* 生成中 */} {taskObject.videos.data[currentSketchIndex].video_status === 0 && (
@@ -499,7 +499,7 @@ export const MediaViewer = React.memo(function MediaViewer({ )} {/* 操作按钮组 */} - + {/* handleEditClick('3')} /> - + */} {/* 底部控制区域 */} { taskObject.videos.data[currentSketchIndex].video_status === 1 && ( @@ -598,7 +598,7 @@ export const MediaViewer = React.memo(function MediaViewer({
{/* 操作按钮组 */} - + {/* handleEditClick('1')} /> - + */} {/* 底部播放按钮 */} @@ -683,9 +683,7 @@ export const MediaViewer = React.memo(function MediaViewer({ return renderSketchContent([...taskObject.roles.data, ...taskObject.scenes.data][currentSketchIndex]); } - if (taskObject.currentStage === 'shot_sketch') { - return renderSketchContent(taskObject.shot_sketch.data[currentSketchIndex]); - } + return null; }); diff --git a/components/pages/work-flow/thumbnail-grid.tsx b/components/pages/work-flow/thumbnail-grid.tsx index 560670e..9ca6472 100644 --- a/components/pages/work-flow/thumbnail-grid.tsx +++ b/components/pages/work-flow/thumbnail-grid.tsx @@ -51,12 +51,19 @@ export function ThumbnailGrid({ if (taskObject.currentStage === 'video') { return taskObject.videos.data; } else if (taskObject.currentStage === 'scene' || taskObject.currentStage === 'character') { - return [...taskObject.roles.data, ...taskObject.scenes.data]; - } else if (taskObject.currentStage === 'shot_sketch') { - return taskObject.shot_sketch.data; + // 为 roles 和 scenes 数据添加唯一标识前缀,避免重复 + const rolesWithPrefix = taskObject.roles.data.map((role, index) => ({ + ...role, + uniqueId: `role_${index}` + })); + const scenesWithPrefix = taskObject.scenes.data.map((scene, index) => ({ + ...scene, + uniqueId: `scene_${index}` + })); + return [...rolesWithPrefix, ...scenesWithPrefix]; } return []; - }, [taskObject.currentStage, taskObject.videos.data, taskObject.scenes.data, taskObject.shot_sketch.data]); + }, [taskObject.currentStage, taskObject.videos.data, taskObject.roles.data, taskObject.scenes.data]); // 使用 useRef 存储前一次的数据,避免触发重渲染 const prevDataRef = useRef([]); @@ -162,7 +169,7 @@ export function ThumbnailGrid({ return (
!isDragging && onSketchSelect(index)} @@ -195,14 +202,7 @@ export function ThumbnailGrid({ /> ) : (
- {`Thumbnail +
)} @@ -230,7 +230,7 @@ export function ThumbnailGrid({ return (
!isDragging && onSketchSelect(index)} @@ -309,7 +309,6 @@ export function ThumbnailGrid({ > {taskObject.currentStage === 'video' && renderVideoThumbnails()} {(taskObject.currentStage === 'scene' || taskObject.currentStage === 'character') && renderSketchThumbnails(getCurrentData())} - {taskObject.currentStage === 'shot_sketch' && renderSketchThumbnails(taskObject.shot_sketch.data)}
); } diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index 8aa13b3..9762b8a 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -15,6 +15,7 @@ export function useWorkflowData() { const searchParams = useSearchParams(); const episodeId = searchParams.get('episodeId') || ''; + const token = localStorage.getItem('token') || ''; let tempTaskObject = useRef({ title: '', @@ -29,10 +30,6 @@ export function useWorkflowData() { data: [], total_count: -1 }, - shot_sketch: { - data: [], - total_count: -1 - }, videos: { data: [], total_count: -1 @@ -108,11 +105,17 @@ export function useWorkflowData() { }, []); useEffect(() => { - if (['video', 'shot_sketch', 'sketch'].includes(taskObject.currentStage)) { + if (['video', 'sketch'].includes(taskObject.currentStage)) { setCurrentSketchIndex(0); } }, [taskObject.currentStage]); + useEffect(() => { + if (token && currentLoadingText.includes('Post-production')) { + window.open(`https://smartcut.huiying.video/ai-editor/${episodeId}?token=${token}`, '_self'); + } + }, [currentLoadingText, token, episodeId]); + useUpdateEffect(() => { console.log('-----look-taskObject_find_changed-----', taskObject); @@ -143,14 +146,7 @@ export function useWorkflowData() { loadingText.current = LOADING_TEXT_MAP.getShotSketchStatus; } } - if (taskObject.currentStage === 'shot_sketch') { - const realShotResultData = taskObject.shot_sketch.data.filter((item: any) => item.status !== 0); - if (taskObject.shot_sketch.total_count > realShotResultData.length) { - loadingText.current = LOADING_TEXT_MAP.shotSketch(realShotResultData.length, taskObject.shot_sketch.total_count); - } else { - loadingText.current = LOADING_TEXT_MAP.getVideoStatus; - } - } + if (taskObject.currentStage === 'video') { const realTaskResultData = taskObject.videos.data.filter((item: any) => item.video_status !== 0); if (taskObject.videos.total_count > realTaskResultData.length) { @@ -166,7 +162,7 @@ export function useWorkflowData() { loadingText.current = LOADING_TEXT_MAP.complete; } setCurrentLoadingText(loadingText.current); - }, [scriptBlocksMemo, taskObject.currentStage, taskObject.scenes.data, taskObject.roles.data, taskObject.shot_sketch.data, taskObject.videos.data, taskObject.status], {mode: 'none'}); + }, [scriptBlocksMemo, taskObject.currentStage, taskObject.scenes.data, taskObject.roles.data, taskObject.videos.data, taskObject.status], {mode: 'none'}); // 将 sketchCount 和 videoCount 放到 redux 中 每一次变化也要更新 @@ -175,10 +171,7 @@ export function useWorkflowData() { if (taskObject.currentStage === 'scene' && taskObject.scenes.data.length > 0) { await autoPlaySketch(taskObject.scenes.data.length); } - if (taskObject.currentStage === 'shot_sketch' && taskObject.shot_sketch.data.length > 0) { - await autoPlaySketch(taskObject.shot_sketch.data.length); - } - }, [taskObject.currentStage, taskObject.scenes.data, taskObject.shot_sketch.data, autoPlaySketch]); + }, [taskObject.currentStage, taskObject.scenes.data, autoPlaySketch]); // 获取流式数据 const fetchStreamData = useCallback(async () => { @@ -256,33 +249,7 @@ export function useWorkflowData() { } // debugger; - if (task.task_name === 'generate_shot_sketch' && task.task_result && task.task_result.data) { - let realShotResultData = task.task_result.data.filter((item: any) => item.url); - if (task.task_status === 'COMPLETED') { - realShotResultData = taskCurrent.shot_sketch.data.filter((item: any) => item.status !== 0); - } - taskCurrent.shot_sketch.total_count = task.task_result.total_count; - if (task.task_status !== 'COMPLETED' || taskCurrent.shot_sketch.total_count !== realShotResultData.length) { - taskCurrent.currentStage = 'shot_sketch'; - console.log('----------正在生成草图中 替换 sketch 数据', realShotResultData.length); - // 正在生成草图中 替换 sketch 数据 - const sketchList = []; - for (const sketch of task.task_result.data) { - sketchList.push({ - url: sketch.url, - script: sketch.description, - status: sketch.url ? 1 : (task.task_status === 'COMPLETED' ? 2 : 0), - type: 'shot_sketch' - }); - } - taskCurrent.shot_sketch.data = sketchList; - if (task.task_status === 'COMPLETED') { - // 草图生成完成 - } - break; - } - - } + if (task.task_name === 'generate_videos' && task.task_result && task.task_result.data) { let realTaskResultData = task.task_result.data.filter((item: any) => (item.urls || (item.video_status !== 0 && item.video_status !== undefined))); @@ -464,27 +431,7 @@ export function useWorkflowData() { // 场景生成完成 } } - if (data.shot_sketch && data.shot_sketch.data) { - taskCurrent.currentStage = 'shot_sketch'; - const realShotResultData = data.shot_sketch.data.filter((item: any) => item.url); - const sketchList = []; - for (const sketch of data.shot_sketch.data) { - sketchList.push({ - url: sketch.url, - script: sketch.description, - status: sketch.url ? 1 : (data.shot_sketch.task_status === 'COMPLETED' ? 2 : 0), - type: 'shot_sketch' - }); - } - taskCurrent.shot_sketch.data = sketchList; - taskCurrent.shot_sketch.total_count = data.shot_sketch.total_count; - // 设置为最后一个草图 - if (data.shot_sketch.total_count > realShotResultData.length) { - // 草图生成中 - } else { - // 草图生成完成 - } - } + if (data.video.data) { const realDataVideoData = data.video.data.filter((item: any) => (item.urls || (item.video_status !== 0 && item.video_status !== undefined))); taskCurrent.currentStage = 'video'; diff --git a/public/assets/cover_image1.jpg b/public/assets/cover_image1.jpg index 04c0856..b2c3cc5 100644 Binary files a/public/assets/cover_image1.jpg and b/public/assets/cover_image1.jpg differ