From 598e4aad76dbc915fae47ff2c61b469732c20c9b Mon Sep 17 00:00:00 2001 From: SoulGateKey Date: Fri, 11 Oct 2024 16:16:40 +0000 Subject: [PATCH] Update mai2/schema/score.py to support new handle_get_game_ranking --- titles/mai2/schema/score.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/titles/mai2/schema/score.py b/titles/mai2/schema/score.py index f62466a..e376216 100644 --- a/titles/mai2/schema/score.py +++ b/titles/mai2/schema/score.py @@ -396,8 +396,11 @@ class Mai2ScoreData(BaseData): return result.fetchall() async def get_playlogs(self, user_id: int, idx: int = 0, limit: int = 0) -> Optional[List[Row]]: - sql = playlog.select(playlog.c.user == user_id) - + if user_id is not None: + sql = playlog.select(playlog.c.user == user_id) + else: + sql = playlog.select() + if limit: sql = sql.limit(limit) if idx: