fixed some formatting and added komga integration stuff

This commit is contained in:
2026-11-04 10:51:50 +00:00
parent 1c2c577280
commit 17708b3ae8
17 changed files with 366 additions and 81 deletions

View File

@@ -5,6 +5,9 @@
"/artwork/[itemId]": [
"src/routes/artwork/[itemId]/+server.ts"
],
"/books/[bookId]": [
"src/routes/books/[bookId]/+server.ts"
],
"/posters/[itemId]": [
"src/routes/posters/[itemId]/+server.ts"
]

View File

@@ -0,0 +1,10 @@
import type * as Kit from '@sveltejs/kit';
import { MatcherParam } from '@sveltejs/kit/params';
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
type RouteParams = { bookId: string };
type RouteId = '/books/[bookId]';
export type EntryGenerator = () => Promise<Array<RouteParams>> | Array<RouteParams>;
export type RequestHandler = Kit.RequestHandler<RouteParams, RouteId>;
export type RequestEvent = Kit.RequestEvent<RouteParams, RouteId>;

View File

@@ -1,20 +1,24 @@
// @ts-nocheck
import type { PageServerLoad } from './$types';
import { getLatestPlaylistSong, getLatestWatchedSeries } from '#lib/server/jellyfin';
import { JELLYFIN_PLAYLIST_ID, JELLYFIN_LIBRARY_ID } from '$app/env/private';
import { getLatestBook } from '#lib/server/komga';
import { JELLYFIN_PLAYLIST_ID, JELLYFIN_LIBRARY_ID, KOMGA_LIBRARY_ID } from '$app/env/private';
export const load = () => {
const latestSong = getLatestPlaylistSong(globalThis.fetch, JELLYFIN_PLAYLIST_ID);
console.log(JELLYFIN_LIBRARY_ID);
const latestSeries = getLatestWatchedSeries(globalThis.fetch, JELLYFIN_LIBRARY_ID);
const latestBook = getLatestBook(globalThis.fetch, KOMGA_LIBRARY_ID);
latestSong.catch(() => {});
latestSeries.catch(() => {});
latestBook.catch(() => {});
return {
streamed: {
latestSong,
latestSeries
latestSeries,
latestBook
}
};
};