Compare commits

..

1 commit

Author SHA1 Message Date
Claude
0799177099
Fix divisionRank ordering and add warning for unknown teams
Some checks failed
🚀 Deploy / 🧪 Test (pull_request) Successful in 2m48s
🚀 Deploy / ʦ🔍 Typecheck & Lint (pull_request) Failing after 49s
🚀 Deploy / 🐳 Build (pull_request) Has been skipped
🚀 Deploy / 🚀 Deploy (pull_request) Has been skipped
Sort teams by win-loss within each division group before assigning
divisionRank so that the leader is always the best-record team, not
whichever team happened to appear first in ESPN's flat response.

Also warn to console when a team's displayName isn't in the hardcoded
MLB_TEAM_DIVISION map, surfacing renames or expansion teams immediately
instead of silently storing division="" and recreating the display bug.

https://claude.ai/code/session_01288dkXYwKJUfXrEhPd8rmo
2026-06-11 20:49:35 +00:00

View file

@ -86,7 +86,6 @@ export class MlbStandingsAdapter implements StandingsSyncAdapter {
const withSm = flattened.map(({ entry, conference, division }) => {
const resolvedDivision = division || MLB_TEAM_DIVISION[entry.team.displayName] || "";
if (!resolvedDivision) {
// eslint-disable-next-line no-console
console.warn(
`[MLB standings] No division found for team "${entry.team.displayName}" (id=${entry.team.id}). ` +
"Update MLB_TEAM_DIVISION if this is a renamed or expansion team."