Files
aigen/server/api/library/index.get.ts
T
TowstyandCursor b7196ecde3 Recover finished Comfy videos after relay restarts.
Persist queued jobs to disk, import leftover MP4s from Comfy history, and do not mark a run complete until the saved video exists.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-25 18:43:15 -05:00

12 lines
355 B
TypeScript

export default defineEventHandler(async (event) => {
const library = publicLibrary(event)
try {
const { owner } = assertLibraryOwner(event)
const folderId = library.folders.find(folder => folder.unlocked)?.id
if (folderId) await importMissingComfyVideos(owner, folderId)
} catch {
return library
}
return publicLibrary(event)
})