去掉 兼容 task_status 未更新

This commit is contained in:
北枳 2025-09-04 23:07:26 +08:00
parent 1b0f043f12
commit bac656d6f7
3 changed files with 4 additions and 8 deletions

View File

@ -56,7 +56,6 @@ const WorkFlow = React.memo(function WorkFlow() {
aiEditingButtonRef.current?.handleAIEditing();
editingNotificationKey.current = `editing-${Date.now()}`;
showEditingNotification({
description: 'AI正在为您编辑视频...', // 可选
key: editingNotificationKey.current,
onFail: () => {
console.log('编辑失败');

View File

@ -53,7 +53,7 @@ interface EditingNotificationProps {
export const showEditingNotification = (props: EditingNotificationProps) => {
const {
isCompleted = false,
description = 'Your video is being edited by AI...',
description = 'The intelligent editing platform is currently editing the videos.',
key,
onComplete,
onFail,
@ -94,7 +94,7 @@ export const showEditingNotification = (props: EditingNotificationProps) => {
const next = prev + (100 - prev) / 10;
if (next >= 99.9) {
setStatus('success');
setCurrentDescription('编辑完成,已更新到页面中');
setCurrentDescription('The editing is complete, and the updated video has been displayed on the page.');
onComplete?.();
clearInterval(timerRef.current);
return 100;
@ -104,7 +104,7 @@ export const showEditingNotification = (props: EditingNotificationProps) => {
} else if (elapsed >= timeLimit) {
// 超时失败
setStatus('exception');
setCurrentDescription('编辑超时,请重试');
setCurrentDescription('The editing timed out, please try again.');
onFail?.();
clearInterval(timerRef.current);
return;

View File

@ -160,7 +160,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps =
useEffect(() => {
if (isShowError) {
msg.error('失败分镜过多,无法执行自动剪辑', 3000);
msg.error('Too many failed storyboards, unable to execute automatic editing.', 3000);
}
}, [isShowError]);
@ -315,8 +315,6 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps =
videoUrls = video.urls ? video.urls.filter((url: null | string) => url !== null) : [];
// 适配旧数据
video_status = video.video_status === undefined ? (videoUrls.length > 0 ? 1 : 0) : video.video_status;
// 完成 还是 0 就是 生成失败
video_status = task.task_status === 'COMPLETED' && video_status === 0 ? 2 : video_status;
// 每一项 video 有多个视频 先默认取第一个
videoList.push({
urls: videoUrls,
@ -506,7 +504,6 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps =
videoUrls = video.urls ? video.urls.filter((url: null | string) => url !== null) : [];
console.log('----------videoUrls', videoUrls);
let video_status = video.video_status === undefined ? (videoUrls.length > 0 ? 1 : 0) : video.video_status;
video_status = data.video.task_status === 'COMPLETED' && video_status === 0 ? 2 : video_status;
// 每一项 video 有多个视频 默认取存在的项
videoList.push({
urls: videoUrls,