import { existsSync } from 'node:fs'; import { studio2LoraCatalog } from '../../utils/studio2/lora-catalog'; import { publicLibrary, stillPath, clipVideoPath } from '../../utils/library'; export default defineEventHandler(event => { const { owner } = assertLibraryOwner(event); const library = publicLibrary(event); const catalog=studio2LoraCatalog(owner); return {...library,loraAliases:catalog.aliases,loraTriggers:catalog.triggers, stills:library.stills.filter(s=>existsSync(stillPath(owner,s.id))), clips:library.clips.filter(c=>existsSync(clipVideoPath(owner,c.id))), tracks:library.tracks || []}; });