Stop cancelled video jobs from coming back after delete.

A leftover process-remaining wake was flipping the row back to running or error, so Remove looked like it did nothing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-30 12:47:59 -05:00
co-authored by Cursor
parent 201eb1107f
commit c88a8494d5
5 changed files with 80 additions and 29 deletions
+9 -6
View File
@@ -537,7 +537,7 @@ const pauseDisabledReason = computed(() => {
return ''
})
const clearableCount = computed(() => (
jobs.value.filter(job => job.status === 'waiting' || job.status === 'held').length
jobs.value.filter(job => job.status === 'waiting' || job.status === 'held' || job.status === 'error').length
+ orphans.value.filter(queue => queue.status !== 'running').length
))
@@ -776,7 +776,7 @@ function jobThumb(job: StudioJobRow) {
}
function canRemoveJob(job: StudioJobRow) {
return job.status === 'waiting' || job.status === 'held' || job.status === 'running'
return job.status === 'waiting' || job.status === 'held' || job.status === 'running' || job.status === 'error'
}
function promptSnippet(text?: string) {
@@ -841,9 +841,12 @@ async function confirmRemove() {
}
async function removeJob(job: StudioJobRow) {
await $fetch(`/api/studio-queue/${job.id}`, { method: 'DELETE' }).catch((err: any) => {
error.value = err?.data?.statusMessage || err?.message || 'Could not remove that job'
})
try {
await $fetch(`/api/studio-queue/${job.id}`, { method: 'DELETE' })
} catch (err: any) {
error.value = err?.data?.statusMessage || err?.statusMessage || err?.message || 'Could not remove that job'
throw err
}
await loadQueues()
}
@@ -1002,7 +1005,7 @@ async function clearAll() {
if (!confirm(`Clear waiting and paused jobs from the queue? Saved clips stay in the library.${extra}`)) return
error.value = ''
try {
for (const job of jobs.value.filter(item => item.status === 'waiting' || item.status === 'held')) {
for (const job of jobs.value.filter(item => item.status === 'waiting' || item.status === 'held' || item.status === 'error')) {
await $fetch(`/api/studio-queue/${job.id}`, { method: 'DELETE' }).catch(() => null)
}
await $fetch('/api/queues', { method: 'DELETE' })