Let queued video, image, and music jobs open in an inspect modal.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
import { cancelLiveMusicJob, findInspectJob } from '~/server/utils/queuedInspect'
|
||||
import { cancelStudioJob } from '~/server/utils/studioQueue'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
const id = String(getRouterParam(event, 'id') || '')
|
||||
const job = findInspectJob(owner, id)
|
||||
if (!job) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'Queued job not found' })
|
||||
}
|
||||
if (job.source === 'live' && job.kind === 'music') {
|
||||
await cancelLiveMusicJob(owner, id)
|
||||
return { ok: true }
|
||||
}
|
||||
await cancelStudioJob(owner, id)
|
||||
return { ok: true }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user