api: add Person and StreamingService contexts

This commit is contained in:
Cron1cle
2025-10-07 20:08:51 +02:00
parent de2778d6db
commit 2dacb9fa80
12 changed files with 390 additions and 111 deletions

View File

@@ -41,14 +41,13 @@ export async function getSeason(
showId: number,
seasonNumber: number
): Promise<Season | null> {
// WICHTIG: trailing Slash entfernt
const url = `${SEASON_BASE_URL}/${showId}/seasons/${seasonNumber}`;
try {
console.log("[getSeason] Fetch:", url);
const res = await fetch(url);
console.log("[getSeason] Status:", res.status);
if (res.status === 404) return null;
if (!res.ok) throw new Error(`Season fetch failed: ${res.status}`);
if (!res.ok) throw new Error("Season fetch failed " + res.status);
const raw: RawSeason = await res.json();
const participants: SeasonParticipant[] = raw.seasonParticipants.map(
(p) => ({