deterministic sort order

This commit is contained in:
Maximilian Keßler 2023-12-04 15:06:40 +01:00
parent 230d96ae1b
commit f5d3cfdad4
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -106,7 +106,8 @@ def get_stat_lists(stat_type: str, order_type: str = 'DESC', precision: int = 0,
" ON users.id = user_accounts.user_id " " ON users.id = user_accounts.user_id "
f" GROUP BY (user_accounts.user_id, player_name, {stat_type}) " f" GROUP BY (user_accounts.user_id, player_name, {stat_type}) "
" ) AS streaks " " ) AS streaks "
f"ORDER BY value {order_type}", # As a tiebreak, just sort by player name for now for determinancy
f"ORDER BY value {order_type}, player_name",
(", ", default, rating_type) (", ", default, rating_type)
) )
for (player_name, user_accounts, value) in cur.fetchall(): for (player_name, user_accounts, value) in cur.fetchall():