fix(playlist): ItemAttemptsCount.completed includes failed scores

This commit is contained in:
MingxuanGame
2025-08-18 12:06:55 +00:00
parent 1e85eab6b3
commit 4aff8cab2d

View File

@@ -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