Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18,627 changes: 0 additions & 18,627 deletions lib/data/sports/4328.json

This file was deleted.

27,055 changes: 27,055 additions & 0 deletions lib/data/sports/4329.json

Large diffs are not rendered by default.

11,179 changes: 11,179 additions & 0 deletions lib/data/sports/4330.json

Large diffs are not rendered by default.

15,001 changes: 15,001 additions & 0 deletions lib/data/sports/4339.json

Large diffs are not rendered by default.

24,997 changes: 24,997 additions & 0 deletions lib/data/sports/4346.json

Large diffs are not rendered by default.

16,485 changes: 4,494 additions & 11,991 deletions lib/data/sports/4350.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/data/sports/4387.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"leagueId": "4387",
"leagueName": "NBA",
"updatedAt": "2026-06-11T02:17:22.772Z",
"updatedAt": "2026-06-11T06:34:00.453Z",
"events": [
{
"idEvent": "2357365",
Expand Down
2 changes: 1 addition & 1 deletion lib/data/sports/4391.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"leagueId": "4391",
"leagueName": "NFL",
"updatedAt": "2026-06-11T02:16:08.358Z",
"updatedAt": "2026-06-11T06:32:46.666Z",
"events": [
{
"idEvent": "2475374",
Expand Down
2 changes: 1 addition & 1 deletion lib/data/sports/4408.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"leagueId": "4408",
"leagueName": "NCAA Basketball",
"updatedAt": "2026-06-11T02:31:36.982Z",
"updatedAt": "2026-06-11T07:07:08.265Z",
"events": [
{
"idEvent": "2317910",
Expand Down
18 changes: 9 additions & 9 deletions lib/data/sports/4480.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"leagueId": "4480",
"leagueName": "UEFA Champions League",
"updatedAt": "2026-06-11T02:32:03.879Z",
"updatedAt": "2026-06-11T07:07:34.939Z",
"events": [
{
"idEvent": "2328005",
Expand Down Expand Up @@ -275,7 +275,7 @@
"strTimeLocal": "20:00:00",
"strGroup": "",
"idHomeTeam": "134108",
"strHomeTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/0pywy21662316682.png",
"strHomeTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/hj4kyc1781152436.png",
"idAwayTeam": "135702",
"strAwayTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/f9h2by1725001244.png",
"intScore": null,
Expand Down Expand Up @@ -1110,7 +1110,7 @@
"idHomeTeam": "133610",
"strHomeTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/yvwvtu1448813215.png",
"idAwayTeam": "134108",
"strAwayTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/0pywy21662316682.png",
"strAwayTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/hj4kyc1781152436.png",
"intScore": null,
"intScoreVotes": null,
"strResult": "",
Expand Down Expand Up @@ -2188,7 +2188,7 @@
"idHomeTeam": "134777",
"strHomeTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/lhwuiz1621593302.png",
"idAwayTeam": "134108",
"strAwayTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/0pywy21662316682.png",
"strAwayTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/hj4kyc1781152436.png",
"intScore": null,
"intScoreVotes": null,
"strResult": "",
Expand Down Expand Up @@ -3411,7 +3411,7 @@
"strTimeLocal": "20:00:00",
"strGroup": "",
"idHomeTeam": "134108",
"strHomeTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/0pywy21662316682.png",
"strHomeTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/hj4kyc1781152436.png",
"idAwayTeam": "133666",
"strAwayTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/3x9k851726760113.png",
"intScore": null,
Expand Down Expand Up @@ -3560,7 +3560,7 @@
"idHomeTeam": "133772",
"strHomeTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/zg9tii1755495289.png",
"idAwayTeam": "134108",
"strAwayTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/0pywy21662316682.png",
"strAwayTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/hj4kyc1781152436.png",
"intScore": null,
"intScoreVotes": null,
"strResult": "",
Expand Down Expand Up @@ -5273,7 +5273,7 @@
"strTimeLocal": "20:00:00",
"strGroup": "",
"idHomeTeam": "134108",
"strHomeTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/0pywy21662316682.png",
"strHomeTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/hj4kyc1781152436.png",
"idAwayTeam": "133670",
"strAwayTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/l8qyxv1742982541.png",
"intScore": null,
Expand Down Expand Up @@ -5961,7 +5961,7 @@
"idHomeTeam": "133676",
"strHomeTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/uxf0gr1742983727.png",
"idAwayTeam": "134108",
"strAwayTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/0pywy21662316682.png",
"strAwayTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/hj4kyc1781152436.png",
"intScore": null,
"intScoreVotes": null,
"strResult": "",
Expand Down Expand Up @@ -6988,7 +6988,7 @@
"strTimeLocal": "20:00:00",
"strGroup": "",
"idHomeTeam": "134108",
"strHomeTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/0pywy21662316682.png",
"strHomeTeamBadge": "https://www.thesportsdb.com/images/media/team/badge/hj4kyc1781152436.png",
"idAwayTeam": "133738",
"strAwayTeamBadge": "https://r2.thesportsdb.com/images/media/team/badge/vwvwrw1473502969.png",
"intScore": "10",
Expand Down
2 changes: 1 addition & 1 deletion lib/data/sports/4481.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"leagueId": "4481",
"leagueName": "UEFA Europa League",
"updatedAt": "2026-06-11T02:32:30.635Z",
"updatedAt": "2026-06-11T07:08:01.422Z",
"events": [
{
"idEvent": "2327866",
Expand Down
2 changes: 1 addition & 1 deletion lib/data/sports/4482.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"leagueId": "4482",
"leagueName": "FA Cup",
"updatedAt": "2026-06-11T02:32:49.506Z",
"updatedAt": "2026-06-11T07:08:20.192Z",
"events": [
{
"idEvent": "2371352",
Expand Down
5 changes: 3 additions & 2 deletions lib/sports.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,13 @@ export async function getUpcomingEvents({ teamId, fetchImpl = globalThis.fetch }
}
}

// Filter for upcoming events (same logic as before: today or later)
// Filter for upcoming events (include ongoing events started in the last 3 hours)
const now = new Date();
const threeHoursAgo = new Date(now.getTime() - 180 * 60 * 1000);
const upcomingEvents = uniqueEvents
.filter((event) => {
const eventDate = parseApiTimestamp(event.timestamp, event.date, event.time);
return eventDate >= now;
return eventDate >= threeHoursAgo;
})
.sort((a, b) => {
const dateA = parseApiTimestamp(a.timestamp, a.date, a.time);
Expand Down
7 changes: 6 additions & 1 deletion scripts/fetch-sports.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ const LEAGUES = [
{ id: '4334', name: 'Ligue 1' },
{ id: '4337', name: 'Eredivisie' },
{ id: '4344', name: 'Primeira Liga' },
{ id: '4350', name: 'MLS' },
{ id: '4346', name: 'MLS' },
{ id: '4350', name: 'Liga MX' },
{ id: '4329', name: 'English Championship' },
{ id: '4339', name: 'Turkish Super Lig' },
{ id: '4330', name: 'Scottish Premiership' },
{ id: '4351', name: 'Brazilian Serie A' },
{ id: '4392', name: 'NCAA Football' },
{ id: '4408', name: 'NCAA Basketball' },
{ id: '4480', name: 'UEFA Champions League' },
Expand Down