Add manual image groups to the library

This commit is contained in:
Towsty
2026-09-07 20:16:01 -05:00
parent 174d40a7dc
commit eeff12cdab
5 changed files with 164 additions and 9 deletions
+11
View File
@@ -0,0 +1,11 @@
export default defineEventHandler(async (event) => {
const { owner } = assertLibraryOwner(event)
const body = await readBody(event)
if (!Array.isArray(body?.ids) || !body.ids.length || body.ids.length > 1000 || body.ids.some((id: unknown) => typeof id !== 'string')) {
throw createError({ statusCode: 400, statusMessage: 'Select images to group' })
}
const ids = [...new Set<string>(body.ids)]
for (const id of ids) assertFolderAccess(event, getStill(owner, id).folderId)
await groupLibraryStills(owner, ids, body.ungroup === true)
return publicLibrary(event)
})