added what im watching

This commit is contained in:
2026-11-03 19:32:08 +00:00
parent 7e8f329109
commit 1c2c577280
19 changed files with 255 additions and 124 deletions

View File

@@ -4,5 +4,8 @@
],
"/artwork/[itemId]": [
"src/routes/artwork/[itemId]/+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 = { itemId: string };
type RouteId = '/posters/[itemId]';
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,16 +1,20 @@
// @ts-nocheck
import type { PageServerLoad } from './$types';
import { getLatestPlaylistSong } from '#lib/server/jellyfin';
import { JELLYFIN_PLAYLIST_ID } from '$app/env/private';
import { getLatestPlaylistSong, getLatestWatchedSeries } from '#lib/server/jellyfin';
import { JELLYFIN_PLAYLIST_ID, JELLYFIN_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);
latestSong.catch(() => {});
latestSeries.catch(() => {});
return {
streamed: {
latestSong
latestSong,
latestSeries
}
};
};