Skip to content

Commit 0ead0f4

Browse files
Merge pull request #320 from RemainingDelta/316-Enhancement
316-Enhancement remove 5-match bottleneck cap
2 parents 18fe787 + 7797c14 commit 0ead0f4

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

features/tourney/tourney_commands.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,16 @@ async def update_progress_dashboard(self):
594594

595595
if data["bottlenecks"]:
596596
bn_text = ""
597-
for bn in data["bottlenecks"][:5]:
598-
bn_text += f"**#{bn['id']}** (Round {bn['round']}) | {bn['team_a']} vs {bn['team_b']} ({bn['score_a']}-{bn['score_b']})\n"
597+
shown = 0
598+
total_bn = len(data["bottlenecks"])
599+
for bn in data["bottlenecks"]:
600+
line = f"**#{bn['id']}** (Round {bn['round']}) | {bn['team_a']} vs {bn['team_b']} ({bn['score_a']}-{bn['score_b']})\n"
601+
if len(bn_text) + len(line) > 1000:
602+
break
603+
bn_text += line
604+
shown += 1
605+
if shown < total_bn:
606+
bn_text += f"*+{total_bn - shown} more...*"
599607
embed.add_field(
600608
name="⚠️ Bottleneck Matches", value=bn_text, inline=False
601609
)
@@ -2990,8 +2998,16 @@ async def tourney_progress(interaction: discord.Interaction):
29902998
# Bottlenecks (Laggards behind dominant round)
29912999
if data["bottlenecks"]:
29923000
bn_text = ""
2993-
for bn in data["bottlenecks"][:5]:
2994-
bn_text += f"**#{bn['id']}** (Round {bn['round']}) | {bn['team_a']} vs {bn['team_b']} ({bn['score_a']}-{bn['score_b']})\n"
3001+
shown = 0
3002+
total_bn = len(data["bottlenecks"])
3003+
for bn in data["bottlenecks"]:
3004+
line = f"**#{bn['id']}** (Round {bn['round']}) | {bn['team_a']} vs {bn['team_b']} ({bn['score_a']}-{bn['score_b']})\n"
3005+
if len(bn_text) + len(line) > 1000:
3006+
break
3007+
bn_text += line
3008+
shown += 1
3009+
if shown < total_bn:
3010+
bn_text += f"*+{total_bn - shown} more...*"
29953011
embed.add_field(name="⚠️ Bottleneck Matches", value=bn_text, inline=False)
29963012
else:
29973013
embed.add_field(

0 commit comments

Comments
 (0)