SGA-A / c2c

Source code for the custom app exclusive to cc
MIT License
1 stars 0 forks source link

Insert a leaderboard filter #8

Closed SGA-A closed 10 months ago

SGA-A commented 10 months ago

Summary

Note

If you wish to set a limit to the number of users displayed on the leaderboard, for example the top 10 users, then insert the following line of code when looping through the sql-fetched query results:

for member in data:
  if index > 10:
      break

Do note however, that adding this change will result in a decline in performance.

Additional Context

In the past, users would only get to see a leaderboard that displayed the users with the most currency. It considered all the mediums in which it came from, but there were no other stats to filter out the top users by. This PR aims to change that.

SGA-A commented 10 months ago

LGTM.