fix: use raw squadron tag for win/loss comparison, not resolved short name
My earlier change to use squadron_short (resolved clean name, e.g. DSPLA) for display broke the win/loss header colour: winning_team is the raw replay value (e.g. -DSPLA-) so the comparison never matched, rendering both teams as losers. Split into squadron_raw (comparison) vs squadron_short (display text) so each uses the right value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-2
@@ -458,7 +458,10 @@ def _create_scoreboard_sync(match_details,
|
|||||||
|
|
||||||
|
|
||||||
# --- 1) Squadron header & points ---
|
# --- 1) Squadron header & points ---
|
||||||
squadron_short = team_data.get("squadron_short") or team_data.get("squadron", "Unknown")
|
# squadron_raw: used for win/loss comparison against winning_team (raw replay value)
|
||||||
|
# squadron_short: resolved clean name used for display only
|
||||||
|
squadron_raw = team_data.get("squadron", "Unknown")
|
||||||
|
squadron_short = team_data.get("squadron_short") or squadron_raw
|
||||||
squadron_long = team_data.get("squadron_long", "Unknown")
|
squadron_long = team_data.get("squadron_long", "Unknown")
|
||||||
matched_diff_source = None
|
matched_diff_source = None
|
||||||
squad_diffs = None
|
squad_diffs = None
|
||||||
@@ -504,7 +507,7 @@ def _create_scoreboard_sync(match_details,
|
|||||||
if is_draw:
|
if is_draw:
|
||||||
fill = Draw_fill
|
fill = Draw_fill
|
||||||
else:
|
else:
|
||||||
fill = Positive_Points_fill if squadron_short == winning_team else Negative_Points_fill
|
fill = Positive_Points_fill if squadron_raw == winning_team else Negative_Points_fill
|
||||||
|
|
||||||
gap = 30
|
gap = 30
|
||||||
if not flipped:
|
if not flipped:
|
||||||
|
|||||||
Reference in New Issue
Block a user