Add local queued video upscale with Real-ESRGAN and RIFE
This commit is contained in:
@@ -28,9 +28,19 @@ export default defineEventHandler(async (event) => {
|
||||
const jobId = String(body?.jobId || '')
|
||||
const kind = String(body?.kind || '')
|
||||
const named = jobId ? getJob(jobId) : undefined
|
||||
if (named?.upscale) {
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
if (named.library?.ownerKey !== owner) throw createError({ statusCode: 404, statusMessage: 'Job not found' })
|
||||
const { cancelUpscaleJob } = await import('~/server/utils/videoUpscale')
|
||||
const { onLiveVideoSettled } = await import('~/server/utils/studioQueue')
|
||||
await cancelUpscaleJob(named)
|
||||
await onLiveVideoSettled(named)
|
||||
return { ok: true, cancelled: 1 }
|
||||
}
|
||||
const targets = named
|
||||
? [named]
|
||||
: listJobs().filter((job) => {
|
||||
if (job.upscale) return false
|
||||
if (job.status === 'complete' || job.status === 'error' || job.status === 'cancelled') return false
|
||||
if (kind === 'edit') return job.kind === 'edit'
|
||||
if (kind === 'music') return job.kind === 'music'
|
||||
@@ -46,6 +56,7 @@ export default defineEventHandler(async (event) => {
|
||||
if (jobId) deletePendingJob(jobId)
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
for (const row of listStudioJobs(owner)) {
|
||||
if (row.payload.upscale) continue
|
||||
if (row.status !== 'running' && row.status !== 'held') continue
|
||||
if (kind === 'edit' && row.kind !== 'edit') continue
|
||||
if (kind === 'music' && row.kind !== 'music') continue
|
||||
|
||||
Reference in New Issue
Block a user