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) await ensureClipThumbnails(owner) } catch { return publicLibrary(event) } return publicLibrary(event) })