Delete Comfy video, image, and audio files from the desktop after they are saved to the library.

Audio never called purge, image stills used untagged names, and a locked file could abort the whole host-agent delete.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-09-03 08:30:05 -05:00
co-authored by Cursor
parent d7045c0a07
commit 110865b370
7 changed files with 209 additions and 43 deletions
+5 -1
View File
@@ -1,5 +1,5 @@
import { createJob, emitJob, type Job } from '~/server/utils/jobs'
import { extractAudio, fetchHistory, fetchHistoryAll, findHistoryAudio, queuePrompt } from '~/server/utils/comfy'
import { extractAudio, fetchHistory, fetchHistoryAll, findHistoryAudio, purgeComfyArtifacts, queuePrompt } from '~/server/utils/comfy'
import { comfyWsUrl } from '~/server/utils/comfy'
import { ensureComfyReady } from '~/server/utils/comfyLifecycle'
import { downloadComfyAudio, saveTrack } from '~/server/utils/library'
@@ -195,6 +195,10 @@ function watchMusicJob(job: Job): Promise<void> {
})
job.trackId = track.id
job.library.audioExt = ext
await purgeComfyArtifacts({
audio,
promptId: job.promptId
})
}
job.status = 'complete'
emitJob(job, {