feat: 接入视频输入规划与任务筛选
This commit is contained in:
1 parent
9747a8f0ab
commit
2c3e72ae9a
7 files changed
+264
-96
No files matched your search
@@ -8,6 +8,8 @@ import { getOperation, runOperation } from '../workflows/operations'
|
||||
import { useWorkflowExecution } from '../workflows/execution'
|
||||
import { productionApi } from './api'
|
||||
import { getProductionSession, validOptionalSize } from './model'
|
||||
import type { VideoInputMode } from './types'
|
||||
import { errorMessage } from '../../lib/http'
|
||||
|
||||
/** 项目级生产动作;每次请求都由统一项目锁防止重复提交。 */
|
||||
export type ProductionCommand = 'prompts' | 'keyframes' | 'videos' | 'retry-videos'
|
||||
@@ -26,6 +28,7 @@ export function useProduction() {
|
||||
const promptLimit = ref<number | null>(1)
|
||||
const videoLimit = ref<number | null>(1)
|
||||
const videoRepairAttempts = ref<number | null>(2)
|
||||
const videoInputMode = ref<VideoInputMode | 'all'>('all')
|
||||
const snapshot = computed(() => breakdownSnapshot(context.checkpoints.value))
|
||||
const sourceEpisodes = computed(
|
||||
() => snapshot.value?.storyboardEpisodeShots ?? snapshot.value?.breakdownResult?.storyboardEpisodeShots ?? []
|
||||
@@ -52,16 +55,28 @@ export function useProduction() {
|
||||
async (key, signal) => {
|
||||
const [projectId, number, overwrite] = JSON.parse(key) as [string, number, boolean]
|
||||
if (!projectId || !number) return null
|
||||
const [directions, prompts, keyframes, videos, videoStatus] = await Promise.all([
|
||||
const [directions, prompts, keyframes, videos, videoStatus, videoInputPlanState] = await Promise.all([
|
||||
storyboardApi.directions(projectId, number, signal),
|
||||
productionApi.promptReadiness(projectId, overwrite, signal),
|
||||
productionApi.keyframeReadiness(projectId, overwrite, signal),
|
||||
productionApi.videoReadiness(projectId, overwrite, signal),
|
||||
productionApi.projectVideoStatus(projectId, signal)
|
||||
productionApi.projectVideoStatus(projectId, signal),
|
||||
productionApi
|
||||
.videoInputPlans(projectId, number, signal)
|
||||
.then(data => ({ data, error: '' }))
|
||||
.catch(cause => ({ data: null, error: errorMessage(cause) }))
|
||||
])
|
||||
if (directions.projectId !== projectId || directions.episodeNo !== number)
|
||||
throw new Error('镜头生产查询返回了不匹配的项目或剧集,请刷新后重试。')
|
||||
return { directions, prompts, keyframes, videos, videoStatus }
|
||||
return {
|
||||
directions,
|
||||
prompts,
|
||||
keyframes,
|
||||
videos,
|
||||
videoStatus,
|
||||
videoInputPlans: videoInputPlanState.data,
|
||||
videoInputPlansError: videoInputPlanState.error
|
||||
}
|
||||
},
|
||||
false
|
||||
)
|
||||
@@ -175,7 +190,9 @@ export function useProduction() {
|
||||
} else if (command === 'videos') {
|
||||
const started = await productionApi.startQualityVideoExecution(projectId, {
|
||||
...input,
|
||||
episodeNo: episodeNo.value,
|
||||
limit: videoLimit.value ?? undefined,
|
||||
...(videoInputMode.value === 'all' ? {} : { inputMode: videoInputMode.value }),
|
||||
maxRepairAttempts: videoRepairAttempts.value ?? 0
|
||||
})
|
||||
await videoExecution.track(started.executionId)
|
||||
@@ -213,6 +230,7 @@ export function useProduction() {
|
||||
promptLimit,
|
||||
videoLimit,
|
||||
videoRepairAttempts,
|
||||
videoInputMode,
|
||||
keyframeValid,
|
||||
promptValid,
|
||||
videoQualityValid,
|
||||
|
||||
Reference in new issue
Block a user