Skip to content
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

fix: Correctly traverse SteamGridDB API pages #985

Conversation

adamantike
Copy link

The SteamGridDB API has a bug, where the total field for the paginated endpoint /v2/grids/game/:gameId sometimes double/triple counts results (e.g. returning total=172 when there are actually 86 results).

To avoid this issue, this change relies on each page's number of results. If the received page has less than the requested amount of grids, we know that is the last page.

adamantike and others added 2 commits July 7, 2024 12:16
The SteamGridDB API has a bug, where the `total` field for the paginated
endpoint `/v2/grids/game/:gameId` sometimes double/triple counts results
(e.g. returning `total=172` when there are actually 86 results).

To avoid this issue, this change relies on each page's number of
results. If the received page has less than the requested amount of
grids, we know that is the last page.
@zurdi15
Copy link
Member

zurdi15 commented Jul 8, 2024

Nice catch and fix! Thank you very much

@zurdi15 zurdi15 merged commit 2d1fa68 into rommapp:master Jul 8, 2024
3 checks passed
@adamantike adamantike deleted the fix/correctly-request-paginated-api-steamgriddb branch July 8, 2024 12:37
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.

None yet

3 participants