fix(daily-challenge): fix don't clear the streak when it has been broken

This commit is contained in:
MingxuanGame
2025-08-25 03:59:17 +00:00
parent d873c227c1
commit db30cb31dc

View File

@@ -142,11 +142,13 @@ async def process_daily_challenge_top():
return return
scores = ( scores = (
await session.exec( await session.exec(
select(PlaylistBestScore).where( select(PlaylistBestScore)
.where(
PlaylistBestScore.room_id == room.id, PlaylistBestScore.room_id == room.id,
PlaylistBestScore.playlist_id == 0, PlaylistBestScore.playlist_id == 0,
col(PlaylistBestScore.score).has(col(Score.passed).is_(True)), col(PlaylistBestScore.score).has(col(Score.passed).is_(True)),
) )
.order_by(col(PlaylistBestScore.total_score).desc())
) )
).all() ).all()
total_score_count = len(scores) total_score_count = len(scores)
@@ -178,3 +180,4 @@ async def process_daily_challenge_top():
): ):
stats.weekly_streak_current = 0 stats.weekly_streak_current = 0
stats.last_update = now stats.last_update = now
await session.commit()