Pause only the current shot batch so a new Generate can run when Beast is idle, without auto-resuming the held list.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { listShotQueues, summarizeQueue } from '~/server/utils/shotQueue'
|
||||
import { isStudioQueuePaused, listStudioJobs, summarizeStudioJob } from '~/server/utils/studioQueue'
|
||||
import { listStudioJobs, summarizeStudioJob } from '~/server/utils/studioQueue'
|
||||
|
||||
export default defineEventHandler((event) => {
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
@@ -28,14 +28,20 @@ export default defineEventHandler((event) => {
|
||||
pendingCount: shotSummary?.pendingCount ?? job.shotCount
|
||||
}
|
||||
})
|
||||
const orphans = full
|
||||
? queues
|
||||
.filter(queue => !claimed.has(queue.id) && queue.status !== 'complete')
|
||||
.map(summarizeQueue)
|
||||
: []
|
||||
return {
|
||||
jobs,
|
||||
orphans: full
|
||||
? queues
|
||||
.filter(queue => !claimed.has(queue.id) && queue.status !== 'complete')
|
||||
.map(summarizeQueue)
|
||||
: [],
|
||||
orphans,
|
||||
waitingCount: jobs.filter(job => job.status === 'waiting').length,
|
||||
paused: isStudioQueuePaused(owner)
|
||||
paused: jobs.some(job => job.pausedByUser === true)
|
||||
|| orphans.some(queue => queue.stopAfterCurrent === true && queue.status !== 'running'),
|
||||
willPause: jobs.some(job => (
|
||||
job.pauseAfterCurrent === true
|
||||
|| (job.status === 'running' && Boolean(job.shotQueueId && byId.get(job.shotQueueId)?.stopAfterCurrent))
|
||||
))
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user