Add paginated library JSON and dedicated still thumbs that never stream archive masters.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
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 || []};
|
||||
});
|
||||
import { studio2LoraCatalog } from '../../utils/studio2/lora-catalog'
|
||||
import { publicLibrary } from '../../utils/library'
|
||||
|
||||
export default defineEventHandler((event) => {
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
// light:true — metadata only; never existsSync every still/clip on the volume
|
||||
const library = publicLibrary(event, { light: true })
|
||||
const catalog = studio2LoraCatalog(owner)
|
||||
return {
|
||||
...library,
|
||||
loraAliases: catalog.aliases,
|
||||
loraTriggers: catalog.triggers,
|
||||
tracks: library.tracks || []
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user