Skip to content

feat(api): add awardKind filter and multi-game filtering to player-games#5042

Merged
wescopeland merged 6 commits into
RetroAchievements:masterfrom
wescopeland:v2-player-game-award-kind-filtering
Jul 14, 2026
Merged

feat(api): add awardKind filter and multi-game filtering to player-games#5042
wescopeland merged 6 commits into
RetroAchievements:masterfrom
wescopeland:v2-player-game-award-kind-filtering

Conversation

@wescopeland

Copy link
Copy Markdown
Member

This PR adds a filter[awardKind] and comma-delimited filter[gameId] support to the V2 player-games resource, which covers the beaten portion of API_GetUserCompletedGames and provides a replacement pathway from API_GetUserProgress.

GET /api/v2/users/{user}/player-games?filter[awardKind]=beaten-casual,beaten-hardcore
GET /api/v2/users/{user}/player-games?filter[gameId]=1,2,3&include=game

Things worth noting:

  • filter[awardKind] accepts beaten-casual and beaten-hardcore, matching the user-awards filter[kind] vocab.
  • Completion/mastery are deliberately absent because that is set-level data.
  • Unknown filter values return a 400.
  • filter[gameId] now accepts a comma-delimited list, so V1's multi-game API_GetUserProgress map is a single V2 request.

@wescopeland
wescopeland requested a review from a team July 3, 2026 17:17
@greptile-apps

greptile-apps Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the new filter logic is correct and well-tested.

The badge-based fallback query correctly adds the user_id column constraint that the relationship omits, the OR grouping prevents filter bleed, unknown values return 400, and test coverage is thorough across all new paths.

No files require special attention.

Reviews (6): Last reviewed commit: "Merge branch 'master' into v2-player-gam..." | Re-trigger Greptile

Comment thread app/Api/V2/PlayerGames/PlayerGameAwardKindFilter.php
Comment thread app/Api/V2/PlayerGames/PlayerGameAwardKindFilter.php
Comment thread app/Api/V2/UserAwards/UserAwardGameAwardTierFilter.php
Comment thread app/Api/V2/PlayerGames/PlayerGameAwardKindFilter.php
@wescopeland
wescopeland enabled auto-merge (squash) July 14, 2026 16:12
@wescopeland
wescopeland merged commit 44289cb into RetroAchievements:master Jul 14, 2026
22 checks passed
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.

2 participants