diff --git a/app/api/matches/route.ts b/app/api/matches/route.ts
index bc7e673..62c0801 100644
--- a/app/api/matches/route.ts
+++ b/app/api/matches/route.ts
@@ -30,8 +30,8 @@ export async function GET() {
}
try {
- const fifaMap = await fetchFifaScores();
- matches = applyFifaScores(matches, fifaMap);
+ const fifaData = await fetchFifaScores();
+ matches = applyFifaScores(matches, teams, fifaData);
} catch (err) {
console.warn("[fifa] Scores fehlgeschlagen:", err instanceof Error ? err.message : err);
}
diff --git a/app/components/Bracket.tsx b/app/components/Bracket.tsx
index 7427184..c4c7dd6 100644
--- a/app/components/Bracket.tsx
+++ b/app/components/Bracket.tsx
@@ -75,6 +75,11 @@ function Tie({
+ {tie.homePenalty != null && tie.awayPenalty != null && (
+
+ ({tie.homePenalty}:{tie.awayPenalty} i.E.)
+
+ )}
);
}
diff --git a/lib/feeds.ts b/lib/feeds.ts
index f251341..9f38236 100644
--- a/lib/feeds.ts
+++ b/lib/feeds.ts
@@ -561,8 +561,25 @@ export function attachKOOdds(matches: Match[], teams: Team[], odds: ParsedOdds[]
const FIFA_BASE = "https://api.fifa.com/api/v3";
const FIFA_SEASON = "285023";
+// FIFA-Code → App-Code (nur Abweichungen; sonst identisch)
+const FIFA_CODE_OVERRIDE: Record = {
+ CRO: "HRV", // Kroatien
+ POR: "PRT", // Portugal
+ SUI: "CHE", // Schweiz
+};
+function fifaCodeToAppCode(fifaCode: string): string {
+ return FIFA_CODE_OVERRIDE[fifaCode] ?? fifaCode;
+}
+
+interface FifaTeamBlock {
+ IdTeam: string; // FIFA-Team-ID
+ Abbreviation: string; // FIFA-Code (z.B. PAR, CRO)
+}
+
interface FifaMatch {
MatchNumber: number;
+ Home: FifaTeamBlock | null;
+ Away: FifaTeamBlock | null;
HomeTeamScore: number | null;
AwayTeamScore: number | null;
HomeTeamPenaltyScore: number | null;
@@ -570,6 +587,7 @@ interface FifaMatch {
MatchStatus: number; // 0=finished, 1=scheduled, else=live
MatchTime: string | null; // z.B. "132'"
ResultType: number | null; // 1=regular, 2=penalties
+ Winner?: string | null; // Team-ID des Siegers
}
interface FifaScores {
@@ -580,10 +598,14 @@ interface FifaScores {
resultType: number | null;
status: MatchStatus;
matchTime: string | null;
+ winnerTeamId: string | null;
}
-// Holt Live-Scores von der FIFA-API. Gibt Map MatchNumber → Scores zurück.
-export async function fetchFifaScores(): Promise