feat: 接入视频输入规划与任务筛选

This commit is contained in:
GouJ committed 2026-09-24 17:04:39 +08:00
1 parent 9747a8f0ab
commit 2c3e72ae9a
7 files changed
+264 -96

No files matched your search

@@ -131,7 +131,9 @@ describe('镜头生产数据契约', () => {
await productionApi.startQualityVideoExecution('project/1', {
concurrency: 3,
force: true,
episodeNo: 2,
limit: 2,
inputMode: 'omni_reference',
maxRepairAttempts: 2
})
expect(fetcher.mock.calls[0]?.[0]).toBe('/api/projects/project%2F1/videos/readiness?force=true')
@@ -139,11 +141,46 @@ describe('镜头生产数据契约', () => {
expect(JSON.parse(String(fetcher.mock.calls[1]?.[1]?.body))).toEqual({
concurrency: 3,
force: true,
episodeNo: 2,
limit: 2,
inputMode: 'omni_reference',
maxRepairAttempts: 2
})
})
it('视频输入规划支持当前集预览和单镜头预览', async () => {
const fetcher = vi.fn<typeof fetch>().mockImplementation(async url => {
const path = String(url)
const shotId = path.includes('/storyboard-shots/') ? 'shot-1' : undefined
return new Response(
JSON.stringify({
data: shotId
? {
shotId,
inputMode: 'first_frame',
reasons: ['主体关系简单'],
metrics: {}
}
: {
projectId: 'project/1',
episodeNo: 3,
readyCount: 1,
firstFrameCount: 1,
omniReferenceCount: 0,
plans: []
}
})
)
})
vi.stubGlobal('fetch', fetcher)
await productionApi.videoInputPlans('project/1', 3)
await productionApi.videoInputPlan('shot-1')
expect(fetcher.mock.calls[0]?.[0]).toBe('/api/projects/project%2F1/video-input-plans?episodeNo=3')
expect(fetcher.mock.calls[1]?.[0]).toBe('/api/storyboard-shots/shot-1/video-input-plan')
expect(fetcher.mock.calls[0]?.[1]?.method).toBe('GET')
expect(fetcher.mock.calls[1]?.[1]?.method).toBe('GET')
})
it('所有首帧生成都先成为候选,并要求费用确认', async () => {
wrapper = mount(KeyframeDialog, {
attachTo: document.body,