diff --git a/plugins/WorldCup2026/v1/dataStreams/scripts/knockout.js b/plugins/WorldCup2026/v1/dataStreams/scripts/knockout.js index f713f989..47c97285 100644 --- a/plugins/WorldCup2026/v1/dataStreams/scripts/knockout.js +++ b/plugins/WorldCup2026/v1/dataStreams/scripts/knockout.js @@ -12,8 +12,13 @@ var stageMap = { result = matches.filter(function(m) { return !m.group; }).map(function(m) { var score = '-'; var status = 'Upcoming'; - if (m.score && m.score.ft) { - score = m.score.ft[0] + '-' + m.score.ft[1]; + if (m.score && (m.score.et || m.score.ft)) { + // Prefer the score after extra time; fall back to the 90-minute (ft) score. + var base = m.score.et || m.score.ft; + score = base[0] + '-' + base[1]; + if (m.score.p) { + score += ' (' + m.score.p[0] + '-' + m.score.p[1] + ' pens)'; + } status = 'Finished'; } diff --git a/plugins/WorldCup2026/v1/dataStreams/scripts/last-match.js b/plugins/WorldCup2026/v1/dataStreams/scripts/last-match.js index 0feb1b6f..074515d1 100644 --- a/plugins/WorldCup2026/v1/dataStreams/scripts/last-match.js +++ b/plugins/WorldCup2026/v1/dataStreams/scripts/last-match.js @@ -25,15 +25,27 @@ if (played.length === 0) { var last = played[0]; var isHome = last.team1 === teamName; var opponent = isHome ? last.team2 : last.team1; - var myScore = isHome ? last.score.ft[0] : last.score.ft[1]; - var oppScore = isHome ? last.score.ft[1] : last.score.ft[0]; - var matchResult = myScore > oppScore ? 'Win' : myScore < oppScore ? 'Loss' : 'Draw'; + // Prefer the score after extra time; fall back to the 90-minute (ft) score. + var base = last.score.et || last.score.ft; + var myScore = isHome ? base[0] : base[1]; + var oppScore = isHome ? base[1] : base[0]; + var score = myScore + '-' + oppScore; + var matchResult; + if (last.score.p) { + // Match went to a penalty shootout — the winner is decided on penalties. + var myPens = isHome ? last.score.p[0] : last.score.p[1]; + var oppPens = isHome ? last.score.p[1] : last.score.p[0]; + score += ' (' + myPens + '-' + oppPens + ' pens)'; + matchResult = myPens > oppPens ? 'Win' : 'Loss'; + } else { + matchResult = myScore > oppScore ? 'Win' : myScore < oppScore ? 'Loss' : 'Draw'; + } result = [{ date: last.date, home_away: isHome ? 'Home' : 'Away', opponent: opponent, - score: myScore + '-' + oppScore, + score: score, result: matchResult, stage: last.group ? 'Group Stage' : (knockoutStageMap[last.round] || last.round), sourceId: sourceId diff --git a/plugins/WorldCup2026/v1/dataStreams/scripts/matches.js b/plugins/WorldCup2026/v1/dataStreams/scripts/matches.js index 0d7d0e1f..45621bd2 100644 --- a/plugins/WorldCup2026/v1/dataStreams/scripts/matches.js +++ b/plugins/WorldCup2026/v1/dataStreams/scripts/matches.js @@ -21,8 +21,13 @@ filtered.sort(function(a, b) { result = filtered.map(function(m) { var score = '-'; var status = 'Upcoming'; - if (m.score && m.score.ft) { - score = m.score.ft[0] + '-' + m.score.ft[1]; + if (m.score && (m.score.et || m.score.ft)) { + // Prefer the score after extra time; fall back to the 90-minute (ft) score. + var base = m.score.et || m.score.ft; + score = base[0] + '-' + base[1]; + if (m.score.p) { + score += ' (' + m.score.p[0] + '-' + m.score.p[1] + ' pens)'; + } status = 'Finished'; } diff --git a/plugins/WorldCup2026/v1/metadata.json b/plugins/WorldCup2026/v1/metadata.json index 307afe0b..71bb24d0 100644 --- a/plugins/WorldCup2026/v1/metadata.json +++ b/plugins/WorldCup2026/v1/metadata.json @@ -1,7 +1,7 @@ { "name": "worldcup2026", "displayName": "FIFA World Cup 2026", - "version": "1.2.1", + "version": "1.2.2", "author": { "name": "@TimWheeler-SQUP", "type": "community"