!isDragging && onSketchSelect(index)}
@@ -195,14 +202,7 @@ export function ThumbnailGrid({
/>
) : (
-

+
)}
@@ -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