import type { PageServerLoad } from './$types'; import { getLatestPlaylistSong, getLatestWatchedSeries } from '#lib/server/jellyfin'; import { getLatestBook } from '#lib/server/komga'; import { getContentItems } from '#lib/server/content'; import { getLatestCommits } from '#lib/server/gitea'; import type { ContentItem } from '#lib/server/content'; import type { GitCommit } from '#lib/server/gitea'; import { JELLYFIN_PLAYLIST_ID, JELLYFIN_LIBRARY_ID, KOMGA_LIBRARY_ID, BLOG_URL, CHANNEL_ID } from '$app/env/private'; export const load: PageServerLoad = () => { const latestSong = getLatestPlaylistSong(globalThis.fetch, JELLYFIN_PLAYLIST_ID); const latestSeries = getLatestWatchedSeries(globalThis.fetch, JELLYFIN_LIBRARY_ID); const latestBook = getLatestBook(globalThis.fetch, KOMGA_LIBRARY_ID); const contentItems: ContentItem = getContentItems(globalThis.fetch, CHANNEL_ID, BLOG_URL); const latestCommits: GitCommit = getLatestCommits(globalThis.fetch, 50); latestSong.catch(() => {}); latestSeries.catch(() => {}); latestBook.catch(() => {}); contentItems.catch(() => {}); latestCommits.catch(() => {}); return { streamed: { latestSong, latestSeries, latestBook, contentItems, latestCommits } }; };