Keep remaining multi-shot clips on a Queue page so prompts can be edited between shots, with process-next or overnight run-all.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-27 14:52:03 -05:00
co-authored by Cursor
parent d50db8e180
commit 73c4356e08
16 changed files with 1049 additions and 25 deletions
+24
View File
@@ -0,0 +1,24 @@
import { getShotQueue, patchShotQueueSegments, updateShotQueue, summarizeQueue } from '~/server/utils/shotQueue'
export default defineEventHandler(async (event) => {
const { owner } = assertLibraryOwner(event)
const id = String(getRouterParam(event, 'id') || '')
const body = await readBody<{
name?: string
autoRun?: boolean
segments?: Array<{ index: number; prompt?: string; duration?: number }>
}>().catch(() => ({}))
if (Array.isArray(body?.segments) && body.segments.length) {
await patchShotQueueSegments(owner, id, body.segments)
}
if (typeof body?.name === 'string' || typeof body?.autoRun === 'boolean') {
await updateShotQueue(owner, id, (queue) => {
if (typeof body.name === 'string') queue.name = body.name.trim().slice(0, 80) || queue.name
if (typeof body.autoRun === 'boolean' && queue.status !== 'running') queue.autoRun = body.autoRun
})
}
const queue = getShotQueue(owner, id)
if (!queue) throw createError({ statusCode: 404, statusMessage: 'Queue not found' })
return summarizeQueue(queue)
})