Add same-mode extra passes to Image v2, and hide Shot script from image Recommend.
Library tiles show a check when selected, and xAIGen can hide a preview from the details pane. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
const id = String(getRouterParam(event, 'id') || '')
|
||||
const body = await readBody<{ folderId?: string; name?: string; family?: boolean; globalLocks?: string; permanenceRefs?: unknown }>(event).catch(() => ({} as { folderId?: string; name?: string; family?: boolean; globalLocks?: string; permanenceRefs?: unknown }))
|
||||
const body = await readBody<{ folderId?: string; name?: string; family?: boolean; globalLocks?: string; permanenceRefs?: unknown; hideThumbnail?: boolean }>(event).catch(() => ({} as { folderId?: string; name?: string; family?: boolean; globalLocks?: string; permanenceRefs?: unknown; hideThumbnail?: boolean }))
|
||||
const folderId = String(body?.folderId || '')
|
||||
const hasName = typeof body?.name === 'string'
|
||||
const family = body?.family === true
|
||||
const hasLocks = typeof body?.globalLocks === 'string'
|
||||
const hasRefs = Array.isArray(body?.permanenceRefs)
|
||||
if (!folderId && !hasName && !hasLocks && !hasRefs) {
|
||||
const hasHide = typeof body?.hideThumbnail === 'boolean'
|
||||
if (!folderId && !hasName && !hasLocks && !hasRefs && !hasHide) {
|
||||
throw createError({ statusCode: 400, statusMessage: 'Choose a library folder or a new name' })
|
||||
}
|
||||
const clip = getClip(owner, id)
|
||||
@@ -28,5 +29,6 @@ export default defineEventHandler(async (event) => {
|
||||
family: family || hasLocks
|
||||
})
|
||||
}
|
||||
if (hasHide) setClipHidden(owner, id, body.hideThumbnail === true)
|
||||
return publicLibrary(event)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user