去掉调用剪辑计划

This commit is contained in:
北枳 2025-09-17 16:24:49 +08:00
parent b2b0d33f40
commit 22e1962841
2 changed files with 1 additions and 83 deletions

View File

@ -1,17 +1,8 @@
<<<<<<< Updated upstream
NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com
# NEXT_PUBLIC_JAVA_URL = http://192.168.120.83:8080 # NEXT_PUBLIC_JAVA_URL = http://192.168.120.83:8080
NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com
NEXT_PUBLIC_CUT_URL = https://smartcut.huiying.video NEXT_PUBLIC_CUT_URL = https://smartcut.huiying.video
=======
# NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com
# NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com
# NEXT_PUBLIC_CUT_URL = https://smartcut.huiying.video
NEXT_PUBLIC_JAVA_URL = https://auth.movieflow.ai
NEXT_PUBLIC_BASE_URL = https://api.video.movieflow.ai
NEXT_PUBLIC_CUT_URL = https://smartcut.movieflow.ai
>>>>>>> Stashed changes
# 失败率 # 失败率
NEXT_PUBLIC_ERROR_CONFIG = 0.1 NEXT_PUBLIC_ERROR_CONFIG = 0.1

View File

@ -3,7 +3,6 @@
import { useState, useEffect, useCallback, useRef, useMemo } from 'react'; import { useState, useEffect, useCallback, useRef, useMemo } from 'react';
import { useSearchParams } from 'next/navigation'; import { useSearchParams } from 'next/navigation';
import { notification } from 'antd'; import { notification } from 'antd';
import { showEditingNotification } from '@/components/pages/work-flow/editing-notification';
import { detailScriptEpisodeNew, getScriptTitle, getRunningStreamData, pauseMovieProjectPlan, resumeMovieProjectPlan, getGenerateEditPlan, regenerateVideoNew } from '@/api/video_flow'; import { detailScriptEpisodeNew, getScriptTitle, getRunningStreamData, pauseMovieProjectPlan, resumeMovieProjectPlan, getGenerateEditPlan, regenerateVideoNew } from '@/api/video_flow';
import { useScriptService } from "@/app/service/Interaction/ScriptService"; import { useScriptService } from "@/app/service/Interaction/ScriptService";
import { useUpdateEffect } from '@/app/hooks/useUpdateEffect'; import { useUpdateEffect } from '@/app/hooks/useUpdateEffect';
@ -141,66 +140,6 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa
} }
}, [taskObject.currentStage]); }, [taskObject.currentStage]);
const generateEditPlan = useCallback(async (retryCount: number) => {
if (isLoadedRef.current) {
return;
}
// 调用重置方法
const resetFunc = (window as any)[`resetProgress_${notificationKey}`];
if (resetFunc) {
resetFunc();
}
// 更新通知内容
showEditingNotification({
key: notificationKey,
description: `Generating intelligent editing plan... ${retryCount ? 'Retry Time: ' + retryCount : ''}`,
successDescription: 'Editing plan generated successfully.',
timeoutDescription: 'Editing plan generation failed. Please refresh and try again.',
timeout: 8 * 60 * 1000
});
// 先停止轮询
await new Promise(resolve => {
setNeedStreamData(false);
resolve(true);
});
setIsLoadingGenerateEditPlan(true);
try {
const response = await getGenerateEditPlan({ project_id: episodeId });
if (!response.data.editing_plan) {
throw new Error(response.message);
}
console.error('生成剪辑计划成功');
setIsGenerateEditPlan(true);
isLoadedRef.current = 'true';
setNeedStreamData(true);
// 销毁生成计划的通知
notification.destroy(notificationKey);
// 触发回调,通知父组件计划生成完成
console.log('📞 calling onEditPlanGenerated callback');
onEditPlanGenerated?.();
setIsLoadingGenerateEditPlan(false);
} catch (error) {
console.error('生成剪辑计划失败:', error);
setNeedStreamData(true);
setIsGenerateEditPlan(false);
// 显示失败通知3秒
showEditingNotification({
key: notificationKey,
description: `Generating intelligent editing plan... ${retryCount ? 'Retry Time: ' + retryCount : ''}`,
timeoutDescription: 'Editing plan generation failed. Retrying later.',
timeout: 3000
});
setTimeout(() => {
notification.destroy(notificationKey);
setIsLoadingGenerateEditPlan(false);
}, 8000);
}
}, [episodeId, onEditPlanGenerated, notificationKey]);
const openEditPlan = useCallback(async () => { const openEditPlan = useCallback(async () => {
window.open(`${cutUrl}/ai-editor/${episodeId}?token=${token}&user_id=${useid}`, '_target'); window.open(`${cutUrl}/ai-editor/${episodeId}?token=${token}&user_id=${useid}`, '_target');
}, [episodeId]); }, [episodeId]);
@ -208,7 +147,7 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa
useEffect(() => { useEffect(() => {
// 主动触发剪辑 // 主动触发剪辑
if (canGoToCut && taskObject.currentStage === 'video' && !isShowError) { if (canGoToCut && taskObject.currentStage === 'video' && !isShowError) {
generateEditPlan(retryCount - 1); onEditPlanGenerated?.();
} }
}, [canGoToCut, taskObject.currentStage, retryCount, isShowError]); }, [canGoToCut, taskObject.currentStage, retryCount, isShowError]);
@ -411,17 +350,6 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa
// 只在第一次检测到视频分析任务时显示通知 // 只在第一次检测到视频分析任务时显示通知
if (analyze_video_total_count > 0 && !isAnalyzing && analyze_video_completed_count !== analyze_video_total_count) { if (analyze_video_total_count > 0 && !isAnalyzing && analyze_video_completed_count !== analyze_video_total_count) {
setIsAnalyzing(true); setIsAnalyzing(true);
// 如果是第一次显示通知才调用showEditingNotification
const resetFunc = (window as any)[`resetProgress_${notificationKey}`];
if (!resetFunc) {
showEditingNotification({
key: notificationKey,
description: 'Preparing intelligent editing plan...',
successDescription: 'Preparing successful',
timeoutDescription: 'Preparing failed, please try again',
timeout: 3 * 60 * 1000
});
}
} }
if (analyze_video_total_count && analyze_video_completed_count === analyze_video_total_count) { if (analyze_video_total_count && analyze_video_completed_count === analyze_video_total_count) {
@ -432,7 +360,6 @@ export function useWorkflowData({ onEditPlanGenerated, editingStatus, onExportFa
setIsAnalyzing(false); setIsAnalyzing(false);
} else { } else {
setIsShowError(true); setIsShowError(true);
notification.destroy(notificationKey);
setIsAnalyzing(false); setIsAnalyzing(false);
} }
} }