feat: atomic maps per server context

This commit is contained in:
aclist committed 2026-02-13 19:49:15 +09:00
1 parent 82c585a195
commit 7e6013bdbd
11 files changed
+157 -100

No files matched your search

+5 -3
View File
@@ -55,16 +55,18 @@ def format_player_count(model: Gtk.TreeModel | None, control: list) -> str:
players = 0
hits: int
status: str
if model is None or len(model) == 0:
if model is None:
return no_servers
else:
hits = len(model)
for row in model:
players += row[4]
control_total = len(control)
hits_pretty = pluralize("matches", hits)
players_pretty = pluralize("players", players)
control_pretty = pluralize("matches", control_total)
status = f"Showing {hits:n}/{control_total:n} {control_pretty} with {players:n} {players_pretty}"
hidden = control_total - hits
hidden_pretty = f" ({hidden:n} hidden)" if hidden > 0 else ""
status = f"Showing {hits:n} {hits_pretty}{hidden_pretty}, {players:n} {players_pretty}."
return status