Keep Studio 2 family tiles tied to existing library files

This commit is contained in:
Towsty
2026-09-11 19:04:03 -05:00
parent b1ffcd6975
commit b5a4882a9c
5 changed files with 31 additions and 11 deletions
+7
View File
@@ -0,0 +1,7 @@
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)))};
});