Move library collections as a group and map v2 identity refs.

Collapsed collection actions now move, rename, delete, and rerun every part so chains stay together. Identity mode follows the v2u3 Ref2VA picture wiring.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-26 22:56:37 -05:00
co-authored by Cursor
parent f54e8da857
commit e334cb7a7a
28 changed files with 1125 additions and 293 deletions
+3 -1
View File
@@ -3,6 +3,8 @@ export default defineEventHandler(async (event) => {
const id = String(getRouterParam(event, 'id') || '')
const clip = getClip(owner, id)
assertFolderAccess(event, clip.folderId)
await deleteClip(owner, id)
const family = ['1', 'true'].includes(String(getQuery(event).family || '').toLowerCase())
if (family) await deleteClipFamily(owner, id)
else await deleteClip(owner, id)
return { ok: true }
})
+8 -3
View File
@@ -1,9 +1,10 @@
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 body = await readBody<{ folderId?: string; name?: string; family?: boolean }>(event).catch(() => ({} as { folderId?: string; name?: string; family?: boolean }))
const folderId = String(body?.folderId || '')
const hasName = typeof body?.name === 'string'
const family = body?.family === true
if (!folderId && !hasName) {
throw createError({ statusCode: 400, statusMessage: 'Choose a library folder or a new name' })
}
@@ -11,8 +12,12 @@ export default defineEventHandler(async (event) => {
assertFolderAccess(event, clip.folderId)
if (folderId) {
assertFolderExists(event, folderId)
await moveClip(owner, id, folderId)
if (family) await moveClipFamily(owner, id, folderId)
else await moveClip(owner, id, folderId)
}
if (hasName) {
if (family) await renameClipFamily(owner, id, body.name || '')
else await renameClip(owner, id, body.name || '')
}
if (hasName) await renameClip(owner, id, body.name || '')
return publicLibrary(event)
})
+1
View File
@@ -5,6 +5,7 @@ export default defineEventHandler(async (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)
}
+1 -1
View File
@@ -33,5 +33,5 @@ export default defineEventHandler(async (event) => {
height: Number(fields.height || 0),
hideInput: fields.hideInput === 'true'
})
return { still, ...publicLibrary(event) }
return { still: still || undefined, ...publicLibrary(event) }
})