-
Notifications
You must be signed in to change notification settings - Fork 3
Ranking for on-going season #187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Related to #50 |
|
Thank you for the PR. I’ll be on vacation, so I’ll be able to review it after November. |
|
@FioX0 test is broken. can you fix it? |
|
Added pagination, as per initial suggestion #50 Also resolved the TEST failure, and added a specific test for this new endpoint. I tried to maintain the same structure and commenting style as the previous endpoints. |
|
@ipdae have you had the chance to review it? If anything isn't up to standard let me know 🙇 |
| from snapshot in _context.RankingSnapshots.AsNoTracking() | ||
| join user in _context.Users.AsNoTracking() on snapshot.AvatarAddress equals user.AvatarAddress | ||
| where snapshot.SeasonId == seasonId && snapshot.RoundId == roundId | ||
| orderby snapshot.Score descending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FioX0 i think if the scores are tied, additional sorting is needed. is it ok?
| int skip = 0, | ||
| int take = 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will cause an error if value is negative.
While there is an endpoint for rankings for when the season ends.
There has been a very big demand from the community to be able to get ranking from the on-going season.
As targets are selected randomly, there shouldn't be any downsides of making the on-going rankings public.
This pull request would allow someone to pull the on-going rankings, or observe previous rounds rankings by using:
http://localhost:5025/leaderboard/participants?seasonId=23&roundId=38
Which would return a sample result of: