From 45300c17791b92f290a5988346ac5b3d479208f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Fri, 8 Dec 2023 22:16:35 +0100 Subject: [PATCH] better variant sorting --- src/render_site.py | 5 +++-- templates/variant.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/render_site.py b/src/render_site.py index d5ce969..9ab6081 100644 --- a/src/render_site.py +++ b/src/render_site.py @@ -335,6 +335,7 @@ def get_variant_rows() -> List[VariantRow]: " SELECT DISTINCT ON (variants.id, variant_base_ratings.num_players)" " variants.id," " variants.num_suits," + " variants.clue_starved," " name," " variant_base_ratings.num_players," " COALESCE(variant_ratings.value_after, variant_base_ratings.rating) AS current_rating " @@ -354,8 +355,8 @@ def get_variant_rows() -> List[VariantRow]: " ON games.variant_id = ratings.id AND games.num_players = ratings.num_players " "LEFT OUTER JOIN game_statistics" " ON games.id = game_statistics.game_id " - "GROUP BY (ratings.id, ratings.name, ratings.num_players, ratings.current_rating)" - "ORDER BY (ratings.id, ratings.num_players)" + "GROUP BY (ratings.id, ratings.name, ratings.clue_starved, ratings.num_players, ratings.current_rating, ratings.num_suits)" + "ORDER BY (ratings.clue_starved, ratings.num_suits, ratings.num_players)" "" ) return [ diff --git a/templates/variant.html b/templates/variant.html index 2dda3c4..613b380 100644 --- a/templates/variant.html +++ b/templates/variant.html @@ -19,7 +19,7 @@ {% endfor %}