import { existsSync } from 'node:fs'; import { publicLibrary, stillPath, clipVideoPath } from '../../utils/library'; export default defineEventHandler(event => { const { owner } = assertLibraryOwner(event); const library = publicLibrary(event); return {...library, stills:library.stills.filter(s=>existsSync(stillPath(owner,s.id))), clips:library.clips.filter(c=>existsSync(clipVideoPath(owner,c.id)))}; });