Skip to content

feature: faceit and premier leaderboard categories - #411

Merged
lukepolo merged 1 commit into
mainfrom
feature/external-rank-leaderboard
Sep 18, 2026
Merged

lukepolo merged 1 commit into
mainfrom
feature/external-rank-leaderboard

Conversation

@lukepolo

Copy link
Copy Markdown
Contributor

Adds two categories to the existing leaderboard: Faceit (rating, with skill level alongside) and Premier (rank). Pairs with 5stackgg/web#TBD.

Both are served by get_leaderboard, so paging, the aggregate count and jump-to-your-rank all work unchanged — the only new SQL is one helper and two dispatcher branches.

Two things they deliberately do differently from every other category:

  • No window, season, match type or source. These are ratings we cache from FACEIT and from parsed Premier demos, not anything derived from matches played here. Filtering a FACEIT rating by "last 7 days" would empty the board rather than narrow it, so the web hides the filter bar for them.
  • An unplaced Premier rank of 0 is no rank, not the worst rank in the game. The demo importer writes 0 for a player who has not placed this season.

The FACEIT ratings behind it used to be refreshed only on demand or during an import, so a leaderboard over them would have gone stale. The existing faceit poll now also tops up the least recently refreshed ratings — bounded to a batch, two at a time, and reusing refreshPlayer's per-player hourly lock, so a busier poll does not mean more calls to an API we do not own.

Tests: 944 unit (+5), 1378 SQL (+9).

- get_leaderboard gains faceit_elo and premier_rank, served from the ratings
  cached on players; an unplaced premier rank of 0 is treated as no rank
- neither takes a window, season or source: a cached rating is not a match
  statistic, and filtering one by last-7-days would empty the board
- the faceit poll now tops up the least recently refreshed ratings, bounded and
  at low concurrency, reusing refreshPlayer's per-player hourly lock
@lukepolo
lukepolo merged commit 377576d into main Sep 18, 2026
2 checks passed
@lukepolo
lukepolo deleted the feature/external-rank-leaderboard branch September 18, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant