Skip to content

fix(googlebooks): report more pages when limit is above the 40 result maximum - #1434

Open
splitsec2 wants to merge 1 commit into
calibrain:mainfrom
splitsec2:fix/googlebooks-has-more
Open

splitsec2 wants to merge 1 commit into
calibrain:mainfrom
splitsec2:fix/googlebooks-has-more

Conversation

@splitsec2

@splitsec2 splitsec2 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Kept small on purpose so it's easy to review. Same kind of small fix as #1429 to #1432, so see the question in #1429 about separate PRs versus combined. I'm sending them separately until I hear otherwise.

search_paginated guesses has_more as len(books) >= options.limit. Google Books returns at most 40 per page and search already caps maxResults at 40, but /api/metadata/search accepts a limit up to 100. With a limit over 40 a full page of 40 never reaches limit, so has_more is always False. The UI sends 40, so this only affects direct API callers.

The Google provider now overrides search_paginated to apply the same cap before the base heuristic runs. A full page of 40 with a limit of 100 reports more results and a short page doesn't. The first test fails on current main. Ruff, basedpyright and tests/metadata pass.

The one red check is the existing clock-dependent test test_a_queued_torrent_asks_for_a_grace_once, which fails on any runner that booted recently. It is fixed in #1426 and is not caused by this change.

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