From db30cb31dc18b859378d1af3e1c1cc1bbb70b912 Mon Sep 17 00:00:00 2001 From: MingxuanGame Date: Mon, 25 Aug 2025 03:59:17 +0000 Subject: [PATCH] fix(daily-challenge): fix don't clear the streak when it has been broken --- app/service/daily_challenge.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/service/daily_challenge.py b/app/service/daily_challenge.py index d313921..dc1596c 100644 --- a/app/service/daily_challenge.py +++ b/app/service/daily_challenge.py @@ -142,11 +142,13 @@ async def process_daily_challenge_top(): return scores = ( await session.exec( - select(PlaylistBestScore).where( + select(PlaylistBestScore) + .where( PlaylistBestScore.room_id == room.id, PlaylistBestScore.playlist_id == 0, col(PlaylistBestScore.score).has(col(Score.passed).is_(True)), ) + .order_by(col(PlaylistBestScore.total_score).desc()) ) ).all() total_score_count = len(scores) @@ -178,3 +180,4 @@ async def process_daily_challenge_top(): ): stats.weekly_streak_current = 0 stats.last_update = now + await session.commit()