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:
@@ -0,0 +1,16 @@
|
||||
import { listPendingJobs } from '~/server/utils/pending'
|
||||
import { listOwnersWithQueues, listShotQueues, pendingSegmentCount } from '~/server/utils/shotQueue'
|
||||
import { startQueueBurst } from '~/server/utils/videoChain'
|
||||
|
||||
export default defineNitroPlugin(() => {
|
||||
const pendingQueueIds = new Set(listPendingJobs().map(job => job.queueId).filter(Boolean))
|
||||
for (const owner of listOwnersWithQueues()) {
|
||||
for (const queue of listShotQueues(owner)) {
|
||||
if (!queue.autoRun) continue
|
||||
if (queue.status === 'complete') continue
|
||||
if (pendingQueueIds.has(queue.id)) continue
|
||||
if (!queue.currentClipId || pendingSegmentCount(queue) === 0) continue
|
||||
void startQueueBurst(owner, queue.id, 'all').catch(() => null)
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user