Fix sports upcoming events count and MLS league mapping#13
Conversation
…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.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThis 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. ChangesSports Events Coverage Expansion
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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.
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