add project

This commit is contained in:
2026-05-17 14:51:37 -04:00
parent 2f1a0d6020
commit fe8dc317b2
40 changed files with 6137 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import type { PageServerLoad } from './$types';
import { getDb } from '$lib/server/db';
import { scanLibraries } from '$lib/server/scanner';
export const load: PageServerLoad = async ({ parent }) => {
const { loggedIn } = await parent();
const db = getDb();
scanLibraries(db);
const games =
loggedIn
? db
.prepare(
`SELECT id, slug, title, library, has_cover, has_wide, genre
FROM games ORDER BY title ASC`
)
.all()
: db
.prepare(
`SELECT id, slug, title, library, has_cover, has_wide, genre
FROM games WHERE library = 'public' ORDER BY title ASC`
)
.all();
return { games };
};