Skip to content

Commit

Permalink
add level_precise
Browse files Browse the repository at this point in the history
  • Loading branch information
HorizonCode committed Mar 13, 2024
1 parent 7502e5b commit 914e725
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/api/v1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ async def api_get_player_info(
)
* 100,
),
"level_precise": get_level_precise(mode_stats["tscore"]),
}

return ORJSONResponse({"status": "success", "player": api_data})
Expand Down
1 change: 1 addition & 0 deletions app/api/v2/models/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ class PlayerStats(BaseModel):
a_count: int
level: int
level_progress: int
level_precise: float
1 change: 1 addition & 0 deletions app/api/v2/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ async def get_player_mode_stats(
response.level_progress = int(
(get_level_precise(data["tscore"]) - get_level(data["tscore"])) * 100,
)
response.level_precise = get_level_precise(data["tscore"]);

return responses.success(response)

Expand Down

0 comments on commit 914e725

Please sign in to comment.