Skip to content

Commit b4737bc

Browse files
Merge pull request #314 from RemainingDelta/202-Bug
202-Bug fix bracket progress showing wrong round numbers
2 parents c163890 + 943ca01 commit b4737bc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

features/tourney/matcherino.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,16 @@ def fetch_bracket_progress(url: str) -> dict:
555555
m["resolved_round"] = m.get("round") or m.get("roundNum") or 1
556556
real_matches.append(m)
557557

558+
# Normalize round numbers so the first real round is always Round 1.
559+
# When participant count is <= half the bracket size, Matcherino gives every
560+
# team a first-round BYE. After filtering those out, resolved_round starts
561+
# at 2+, shifting every displayed round label up by one.
562+
if real_matches:
563+
min_round = min(m["resolved_round"] for m in real_matches)
564+
if min_round > 1:
565+
for m in real_matches:
566+
m["resolved_round"] -= min_round - 1
567+
558568
# Build visual numbering map (the numbers staff see on the bracket UI).
559569
# We keep this consistent with fetch_ticket_context: sort visible matches by API matchNum
560570
# and assign sequential visual numbers.

0 commit comments

Comments
 (0)