diff --git a/app/models/scoring-event.ts b/app/models/scoring-event.ts index c59ad96..6120309 100644 --- a/app/models/scoring-event.ts +++ b/app/models/scoring-event.ts @@ -508,6 +508,7 @@ export async function getUpcomingEventsForDraftedParticipants( const participantsByEntry = new Map>(); const gameKeysByEntry = new Map>(); const earliestTimeByEntry = new Map(); + const isSeriesByEntry = new Map(); for (const row of rows) { const isSeries = (maxGameNumberByEvent.get(row.id) ?? 1) > 1; @@ -527,6 +528,7 @@ export async function getUpcomingEventsForDraftedParticipants( }); participantsByEntry.set(entryKey, new Map()); gameKeysByEntry.set(entryKey, new Set()); + isSeriesByEntry.set(entryKey, isSeries); } const pMap = participantsByEntry.get(entryKey); @@ -559,19 +561,17 @@ export async function getUpcomingEventsForDraftedParticipants( const earliest = earliestTimeByEntry.get(entryKey); event.earliestGameTime = earliest ? earliest.toISOString() : null; - const eventId = entryKey.split("|")[0]; - const isSeries = (maxGameNumberByEvent.get(eventId) ?? 1) > 1; + const isSeries = isSeriesByEntry.get(entryKey) ?? false; const gameKeys = gameKeysByEntry.get(entryKey) ?? new Set(); if (isSeries) { - // Each entry is for a specific game in a series — always show the game number. if (gameKeys.size >= 1) { const [round, gameNumberStr] = [...gameKeys][0].split("|"); event.matchLabel = round === event.name ? `Game #${gameNumberStr}` : `${round} Game #${gameNumberStr}`; } } else { - // Single-game matchup — show the round name, no game number. + // Single-game: omit the game number, just show the round name. if (gameKeys.size === 1) { const [round] = [...gameKeys][0].split("|"); event.matchLabel = round === event.name ? null : round;