From ee9381d1f08e13fe7b1e4cc7a2ba1f72c791bc34 Mon Sep 17 00:00:00 2001 From: MingxuanGame Date: Mon, 11 Aug 2025 09:55:15 +0000 Subject: [PATCH] fix(user): wrong order for best & recent scores --- app/database/oauth_clients.py | 0 app/router/user.py | 2 ++ 2 files changed, 2 insertions(+) create mode 100644 app/database/oauth_clients.py diff --git a/app/database/oauth_clients.py b/app/database/oauth_clients.py new file mode 100644 index 0000000..e69de29 diff --git a/app/router/user.py b/app/router/user.py index e8d0a45..e45426d 100644 --- a/app/router/user.py +++ b/app/router/user.py @@ -164,8 +164,10 @@ async def get_user_scores( order_by = col(Score.pinned_order).asc() elif type == "best": where_clause &= exists().where(col(PPBestScore.score_id) == Score.id) + order_by = col(Score.pp).desc() elif type == "recent": where_clause &= Score.ended_at > datetime.now(UTC) - timedelta(hours=24) + order_by = col(Score.ended_at).desc() elif type == "firsts": # TODO where_clause &= false()