Skip to content

Fix sports upcoming events count and MLS league mapping#13

Merged
DisabledAbel merged 2 commits into
mainfrom
fix-sports-upcoming-events-count-4010885108012030262
Jun 11, 2026
Merged

Fix sports upcoming events count and MLS league mapping#13
DisabledAbel merged 2 commits into
mainfrom
fix-sports-upcoming-events-count-4010885108012030262

Conversation

@DisabledAbel

@DisabledAbel DisabledAbel commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Corrected the league ID for MLS (from 4350 to 4346) which was preventing the system from finding the full schedule for MLS teams. Also adjusted the upcoming event filter to include games that started within the last 3 hours, ensuring ongoing games aren't prematurely removed from the calendar. Verified that teams like LA Galaxy now correctly show their full upcoming schedule.


PR created automatically by Jules for task 4010885108012030262 started by @DisabledAbel

Summary by CodeRabbit

  • New Features
    • Added support for MLS and Liga MX sports leagues
    • Updated upcoming events filter to include matches from the last 3 hours

…uding ongoing games

This change addresses the issue where only one upcoming game was shown for some sports teams.
The root cause was an incorrect league ID for MLS (mapping to Liga MX) and a strict upcoming filter that excluded ongoing games.

Changes:
- Corrected MLS league ID from 4350 to 4346 in `scripts/fetch-sports.js`.
- Renamed league ID 4350 to "Liga MX".
- Updated `lib/sports.js` to include events started within the last 180 minutes.
- Updated local cache files for MLS and Liga MX with full season data.
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
make-ics Ready Ready Preview, Comment Jun 11, 2026 7:16am

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@DisabledAbel, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 1 minute and 49 seconds. Learn how PR review limits work.

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 90e55ba5-66ec-4b38-b948-b379bcf67121

📥 Commits

Reviewing files that changed from the base of the PR and between fdc4352 and 6b78593.

📒 Files selected for processing (12)
  • lib/data/sports/4329.json
  • lib/data/sports/4330.json
  • lib/data/sports/4339.json
  • lib/data/sports/4346.json
  • lib/data/sports/4350.json
  • lib/data/sports/4387.json
  • lib/data/sports/4391.json
  • lib/data/sports/4408.json
  • lib/data/sports/4480.json
  • lib/data/sports/4481.json
  • lib/data/sports/4482.json
  • scripts/fetch-sports.js
📝 Walkthrough

Walkthrough

This PR expands sports event coverage by widening the event time filtering window from strictly-future events to include events up to 3 hours in the past, and adds two soccer leagues (MLS and Liga MX) to the tracked league list.

Changes

Sports Events Coverage Expansion

Layer / File(s) Summary
Event filtering time window expansion
lib/sports.js
The getUpcomingEvents filter now includes events from the last 3 hours rather than only from the current moment onward, computed as current time minus 3 hours.
Tracked leagues expansion
scripts/fetch-sports.js
MLS (id: '4346') and Liga MX (id: '4350') are added to the LEAGUES array to include these soccer leagues in subsequent event fetching and output generation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • DisabledAbel/MakeICS#11: Both PRs modify the event filtering in getUpcomingEvents; this PR widens the lower time bound to include the last 3 hours, while the related PR addressed the merged event deduplication logic.

Poem

🐰 The leagues grow wide, the hours stretch back,
MLS and Liga MX join the pack,
Three hours of past events now stay,
More soccer news for every day! ⚽

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the two main changes: fixing the MLS league mapping and adjusting the upcoming events filter to include recent games.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-sports-upcoming-events-count-4010885108012030262

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

This change ensures that full sports schedules are displayed for more teams and leagues.
The root cause of missing games was an incorrect league ID for MLS and the reliance on an API endpoint limited to 15 results when local cache was missing.

Changes:
- Corrected MLS league ID (4346) and Liga MX (4350) in `scripts/fetch-sports.js`.
- Expanded `scripts/fetch-sports.js` to include English Championship, Turkish Super Lig, Scottish Premiership, and Brazilian Serie A.
- Updated `lib/sports.js` to include ongoing games (started within the last 3 hours).
- Updated local cache files with full season data for these leagues to bypass API result limits.
- Fixed a bug in `lib/sports.js` to handle teams with multiple league affiliations correctly.
@DisabledAbel DisabledAbel merged commit e07689f into main Jun 11, 2026
4 checks passed
@DisabledAbel DisabledAbel deleted the fix-sports-upcoming-events-count-4010885108012030262 branch June 11, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant