Expose aspect, CFG, FPS, sampler, and scheduler in Generation settings, persist them on clips and held jobs, and inject those values into the Comfy graph. Keep the image picker stills-only and allow renaming library clips. Co-authored-by: Cursor <cursoragent@cursor.com>
19 lines
790 B
TypeScript
19 lines
790 B
TypeScript
export default defineEventHandler(async (event) => {
|
|
const { owner } = assertLibraryOwner(event)
|
|
const id = String(getRouterParam(event, 'id') || '')
|
|
const body = await readBody<{ folderId?: string; name?: string }>(event).catch(() => ({} as { folderId?: string; name?: string }))
|
|
const folderId = String(body?.folderId || '')
|
|
const hasName = typeof body?.name === 'string'
|
|
if (!folderId && !hasName) {
|
|
throw createError({ statusCode: 400, statusMessage: 'Choose a library folder or a new name' })
|
|
}
|
|
const clip = getClip(owner, id)
|
|
assertFolderAccess(event, clip.folderId)
|
|
if (folderId) {
|
|
assertFolderExists(event, folderId)
|
|
await moveClip(owner, id, folderId)
|
|
}
|
|
if (hasName) await renameClip(owner, id, body.name || '')
|
|
return publicLibrary(event)
|
|
})
|