Make library hide/reveal instant instead of rewriting the whole catalog.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,7 +29,7 @@ export default defineEventHandler(async (event) => {
|
||||
family: family || hasLocks
|
||||
})
|
||||
}
|
||||
if (hasHide) setClipHidden(owner, id, body.hideThumbnail === true, family)
|
||||
if (hasHide) await setClipHidden(owner, id, body.hideThumbnail === true, family)
|
||||
if (hasHide && !folderId && !hasName && !hasLocks && !hasRefs) {
|
||||
return { id, hideThumbnail: body.hideThumbnail === true }
|
||||
}
|
||||
|
||||
@@ -20,6 +20,9 @@ export default defineEventHandler(async (event) => {
|
||||
if (family) await renameStillFamily(owner, id, body.name || '')
|
||||
else await renameStill(owner, id, body.name || '')
|
||||
}
|
||||
if (hasHide) setStillHidden(owner, id, body.hideInput === true, family)
|
||||
if (hasHide) await setStillHidden(owner, id, body.hideInput === true, family)
|
||||
if (hasHide && !folderId && !hasName) {
|
||||
return { id, hideInput: body.hideInput === true }
|
||||
}
|
||||
return publicLibrary(event)
|
||||
})
|
||||
|
||||
@@ -298,7 +298,6 @@ function readCatalog(owner: string): Catalog {
|
||||
writeFileSync(path, JSON.stringify(catalog, null, 2))
|
||||
return catalog
|
||||
}
|
||||
if (purgeStrayExtensionStills(owner, catalog).count) writeCatalog(owner, catalog)
|
||||
return catalog
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user