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:
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user