Nest shot scripts under Queue jobs, keep the studio from overflowing on phones, and lighten library thumbs and polling so the UI stays responsive.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-27 22:27:17 -05:00
co-authored by Cursor
parent dec1a49bef
commit b2c59c3423
14 changed files with 634 additions and 133 deletions
+9 -10
View File
@@ -1,13 +1,12 @@
export default defineEventHandler(async (event) => {
export default defineEventHandler((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)
await sweepOwnerExtensionStills(owner)
} catch {
return publicLibrary(event)
const light = String(getQuery(event).light || '') === '1'
if (!light) {
try {
const { owner } = assertLibraryOwner(event)
const folderId = library.folders.find(folder => folder.unlocked)?.id
void maintainLibrary(owner, folderId).catch(() => null)
} catch { /* locked or anonymous — still return what we can */ }
}
return publicLibrary(event)
return library
})