Skip to content

Commit

Permalink
Add function to retrieve player count in leaderboards
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekuruu committed Nov 9, 2023
1 parent e52c875 commit bef2f9e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cache/leaderboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,16 @@ def top_countries(

return total_scores

def player_count(
mode: int,
type: str = 'performance'
) -> int:
return app.session.redis.zcount(
f'bancho:{type}:{mode}',
'-inf',
'+inf'
)

def player_above(
user_id: int,
mode: int,
Expand Down

0 comments on commit bef2f9e

Please sign in to comment.