From 4aff8cab2dee042f4e8bee7cc51460de4ae804cb Mon Sep 17 00:00:00 2001 From: MingxuanGame Date: Mon, 18 Aug 2025 12:06:55 +0000 Subject: [PATCH] fix(playlist): `ItemAttemptsCount.completed` includes failed scores --- app/database/playlist_attempts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/database/playlist_attempts.py b/app/database/playlist_attempts.py index e628008..f8a8f0c 100644 --- a/app/database/playlist_attempts.py +++ b/app/database/playlist_attempts.py @@ -61,7 +61,7 @@ class ItemAttemptsCount(AsyncAttrs, ItemAttemptsCountBase, table=True): self.attempts = sum(score.attempts for score in playlist_scores) self.total_score = sum(score.total_score for score in playlist_scores) self.pp = sum(score.score.pp for score in playlist_scores) - self.completed = len(playlist_scores) + self.completed = len([score for score in playlist_scores if score.score.passed]) self.accuracy = ( sum(score.score.accuracy for score in playlist_scores) / self.completed if self.completed > 0