Fix MLB division leaders showing under wildcard #84

Merged
chrisp merged 1 commit from fix/mlb-division-rank into main 2026-06-11 00:25:19 +00:00

1 commit

Author SHA1 Message Date
Chris Parsons
6ef4d39d14 Fix MLB division leaders showing under wildcard instead of division sections
All checks were successful
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m45s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Successful in 1m23s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
The MlbStandingsAdapter never populated `divisionRank`, so every team
evaluated to `divisionRank ?? 99 > 1` in `buildDivisionSections` and
fell through to the wildcard section.

Computes `divisionRank` per team using ESPN's existing division entry
order (which already applies MLB's official tiebreakers) rather than
re-sorting, then passes it through to the upsert.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 12:47:56 -07:00