blanchon commited on
Commit
8053cd4
·
1 Parent(s): 9d3dfa1

Match page: cap timeline to round's official end-tick

Browse files

Some POVs ship trailing post-round spectator footage — e.g. round 14 of
match 2392266 has player 2 at 96s while every other POV is 61.15s and
the round officially ends at freeze_end+61.15s. The timeline was using
max(playerDurations), so the slider stretched to 96s and everyone sat
through 35s of dead air after the round ended.

Now we take min(longestPlayerDuration, (round_end - freeze_end)/64),
defaulting to the longest-player value when round meta is missing.

src/routes/match/[matchId]/[mapName]/+page.svelte CHANGED
@@ -136,9 +136,24 @@
136
  return set;
137
  });
138
 
139
- // Uniform timeline: the round runs until the longest-lived player's clip
140
- // ends, regardless of which perspective is currently being watched.
141
- const roundDuration = $derived(Math.max(0, ...Array.from(playerDurations.values())));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  const activePlayerDuration = $derived(playerDurations.get(currentPlayer) ?? 0);
143
  const activePlayerOutOfFrame = $derived(
144
  activePlayerDuration > 0 && virtualTime >= activePlayerDuration - 0.05
 
136
  return set;
137
  });
138
 
139
+ // Uniform timeline: cap the round to the official end-tick from
140
+ // rounds.parquet so anomalous POVs with trailing post-death spectator
141
+ // footage (occasionally tens of seconds long) don't pad the slider with
142
+ // dead air. Fall back to the longest player clip when the round meta is
143
+ // missing or zero.
144
+ const TICK_RATE = 64;
145
+ const currentRound = $derived(data.rounds.find((r) => r.round === currentRoundNum));
146
+ const roundMetaDuration = $derived(
147
+ currentRound ? (currentRound.round_end_tick - currentRound.freeze_end_tick) / TICK_RATE : 0
148
+ );
149
+ const longestPlayerDuration = $derived(
150
+ Math.max(0, ...Array.from(playerDurations.values()))
151
+ );
152
+ const roundDuration = $derived(
153
+ roundMetaDuration > 0
154
+ ? Math.min(longestPlayerDuration, roundMetaDuration)
155
+ : longestPlayerDuration
156
+ );
157
  const activePlayerDuration = $derived(playerDurations.get(currentPlayer) ?? 0);
158
  const activePlayerOutOfFrame = $derived(
159
  activePlayerDuration > 0 && virtualTime >= activePlayerDuration - 0.05