books-ui: library, detail page, EPUB/PDF reader, reading status/rating/sessions migration, progress/notes APIs, owner gating and tests
This commit is contained in:
12
src/routes/trackers/books/+page.server.ts
Normal file
12
src/routes/trackers/books/+page.server.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { isOwner } from '#lib/server/owner.js';
|
||||
import { libraryCards, libraryStats } from '#lib/server/books/library.js';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
// Public catalogue: covers, titles, status, progress and rating. Files, formats and
|
||||
// placeholders (no file yet) are only included for the owner.
|
||||
export const load: PageServerLoad = async (event) => {
|
||||
const owner = isOwner(event);
|
||||
if (owner) event.setHeaders({ 'cache-control': 'private, no-store' });
|
||||
const [books, stats] = await Promise.all([libraryCards(owner), libraryStats()]);
|
||||
return { books, stats, owner };
|
||||
};
|
||||
Reference in New Issue
Block a user