diff --git a/app/components/scoring/SeasonStandings.tsx b/app/components/scoring/SeasonStandings.tsx index f68ed33..bb7778d 100644 --- a/app/components/scoring/SeasonStandings.tsx +++ b/app/components/scoring/SeasonStandings.tsx @@ -99,18 +99,14 @@ export function SeasonStandings({ {title} - - {isFinalized ? ( + {isFinalized && ( + Season complete — fantasy points assigned to top 8 finishers - ) : ( - <> - Current championship standings. Positions calculated from points (highest = 1st). - - )} - + + )} {standings.length === 0 ? ( diff --git a/app/components/scoring/SportSeasonDisplay.tsx b/app/components/scoring/SportSeasonDisplay.tsx index eec53f5..fa4962d 100644 --- a/app/components/scoring/SportSeasonDisplay.tsx +++ b/app/components/scoring/SportSeasonDisplay.tsx @@ -173,7 +173,7 @@ export function SportSeasonDisplay({ userParticipantIds={userParticipantIds} showOwnership={showOwnership} isFinalized={seasonIsFinalized} - title={sportSeasonName} + title={`${sportSeasonName} Standings`} /> ); diff --git a/app/routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.server.ts b/app/routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.server.ts index 2b33e66..4eeb5b8 100644 --- a/app/routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.server.ts +++ b/app/routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.server.ts @@ -333,9 +333,6 @@ export async function loader(args: Route.LoaderArgs) { ]) : [[], []]; - // Derive seasonIsFinalized from status - const seasonIsFinalized = sportsSeason.status === "completed"; - // Build participantId → expectedValue map for display const participantEvs = Object.fromEntries( regularSeasonEvs.map((ev) => [ev.participantId, ev.expectedValue]) @@ -357,7 +354,6 @@ export async function loader(args: Route.LoaderArgs) { userParticipantIds, upcomingEvents, recentEvents, - seasonIsFinalized, regularSeasonStandings, participantEvs, groupStandings, diff --git a/app/routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.tsx b/app/routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.tsx index 119c31c..1e9c0ef 100644 --- a/app/routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.tsx +++ b/app/routes/leagues/$leagueId.sports-seasons.$sportsSeasonId.tsx @@ -38,7 +38,6 @@ export default function SportSeasonDetail({ userParticipantIds, upcomingEvents, recentEvents, - seasonIsFinalized, regularSeasonStandings, groupStandings, @@ -109,7 +108,7 @@ export default function SportSeasonDetail({ participantPoints={participantPoints} partialScoreParticipantIds={partialScoreParticipantIds} seasonStandings={seasonStandings} - seasonIsFinalized={seasonIsFinalized} + seasonIsFinalized={sportsSeason.status === "completed"} qpStandings={qpStandings} qpIsFinalized={sportsSeason.qualifyingPointsFinalized || false} totalMajors={sportsSeason.totalMajors} diff --git a/app/services/standings-sync/__tests__/f1.test.ts b/app/services/standings-sync/__tests__/f1.test.ts index 16687a4..76e0550 100644 --- a/app/services/standings-sync/__tests__/f1.test.ts +++ b/app/services/standings-sync/__tests__/f1.test.ts @@ -42,7 +42,7 @@ const SAMPLE_ESPN_INDYCAR = { athlete: { id: "3097", displayName: "Scott Dixon" }, stats: [ { name: "rank", value: 1 }, - { name: "points", value: 437 }, + { name: "championshipPts", value: 437 }, { name: "wins", value: 3 }, { name: "starts", value: 10 }, ], @@ -51,7 +51,7 @@ const SAMPLE_ESPN_INDYCAR = { athlete: { id: "3098", displayName: "Alex Palou" }, stats: [ { name: "rank", value: 2 }, - { name: "points", value: 398 }, + { name: "championshipPts", value: 398 }, { name: "wins", value: 2 }, { name: "starts", value: 10 }, ], diff --git a/app/services/standings-sync/f1.ts b/app/services/standings-sync/f1.ts index 342c451..4bdc2e8 100644 --- a/app/services/standings-sync/f1.ts +++ b/app/services/standings-sync/f1.ts @@ -114,7 +114,11 @@ export class IndyCarStandingsAdapter implements StandingsSyncAdapter { return entries.map((entry, idx): FetchedStandingsRecord => { const sm = statsMap(entry.stats); - const points = sm.get("points")?.value ?? sm.get("pts")?.value ?? 0; + const points = + sm.get("championshipPts")?.value ?? + sm.get("points")?.value ?? + sm.get("pts")?.value ?? + 0; const wins = sm.get("wins")?.value ?? 0; const starts = sm.get("starts")?.value ?? sm.get("racesStarted")?.value ?? 0; const rank = sm.get("rank")?.value ?? sm.get("position")?.value ?? idx + 1;