fix(multiplayer): fix acc bug on leaderboards
This commit is contained in:
@@ -61,8 +61,7 @@ class ItemAttemptsCount(ItemAttemptsCountBase, table=True):
|
||||
self.pp = sum(score.score.pp for score in playlist_scores)
|
||||
self.completed = len(playlist_scores)
|
||||
self.accuracy = (
|
||||
sum(score.score.accuracy * score.attempts for score in playlist_scores)
|
||||
/ self.completed
|
||||
sum(score.score.accuracy for score in playlist_scores) / self.completed
|
||||
if self.completed > 0
|
||||
else 0.0
|
||||
)
|
||||
@@ -111,4 +110,5 @@ class ItemAttemptsResp(ItemAttemptsCountBase):
|
||||
)
|
||||
if "position" in include:
|
||||
resp.position = await item_attempts.get_position(session)
|
||||
# resp.accuracy *= 100
|
||||
return resp
|
||||
|
||||
@@ -169,6 +169,7 @@ async def get_room_leaderboard(
|
||||
for i, agg in enumerate(aggs):
|
||||
resp = await ItemAttemptsResp.from_db(agg, db)
|
||||
resp.position = i + 1
|
||||
# resp.accuracy *= 100
|
||||
aggs_resp.append(resp)
|
||||
if agg.user_id == current_user.id:
|
||||
user_agg = resp
|
||||
|
||||
Reference in New Issue
Block a user