Skip to content

SeerrNG Books discovery and library loading #720

Done

Description

@MrJay84

SeerrNG Books discovery and library loading

Environment

  • SeerrNG 3.72.40 (ghcr.io/snapetech-org/seerrng:latest)
  • ChaptarrNG is configured as the ebook and audiobook service.
  • The Books page showed: “Book discovery is unavailable right now. Open Library could not be reached. Try again.”
  • The desired behavior is to display books already in the ChaptarrNG library.

Steps to reproduce

  1. Configure SeerrNG with a ChaptarrNG-compatible book service containing an ebook library.
  2. Sign in to SeerrNG and open Discover → Books.
  3. Select Available and the Ebooks format.
  4. Leave the page at or near the bottom of the results list, or use a viewport/scroll position that keeps the list close to the bottom.
  5. Observe that /api/v1/discover/books?page=N&... continues requesting successive pages without a deliberate “load more” action. In the affected installation, requests advanced rapidly into the dozens of pages.
  6. After enough requests, observe intermittent HTTP 429 responses and the generic “Open Library could not be reached” banner. Cover requests may also return HTTP 429.

To reproduce the query-parameter bug after routing Available to the library endpoint, send a discovery-only parameter such as sortBy to /api/v1/book/library?format=ebook&sortBy=ranked. The endpoint rejects it with Unknown query parameter 'sortBy'.

Findings

  1. The Books page’s Available view was still requesting /api/v1/discover/books, which returns discovery results. The browser did not initially call the separate in-library endpoint, /api/v1/book/library.

  2. Books discovery automatically fetched many pages. The client bundle checked whether the page was near the bottom on a 500 ms interval, as well as on scroll and resize. Open Library reported roughly 43.8 million results (totalPages around 876,480 at 50 results per page), so this could keep fetching pages indefinitely. Traefik logs showed rapid requests through pages 37–134, followed by further page requests.

  3. Requests intermittently returned HTTP 429. SeerrNG’s logs also explicitly recorded HTTP 429 “Too Many Requests” from covers.openlibrary.org. A direct search request to openlibrary.org returned HTTP 200 when checked after the burst. This points to temporary rate limiting from excessive requests, rather than a persistent network or Docker connectivity failure.

  4. The UI’s generic Open Library error obscured the rate-limit failure. The in-library route also rejects discovery-only query parameters: after the Available view was switched to /api/v1/book/library, passing sortBy caused Unknown query parameter 'sortBy', which was again presented with the misleading Open Library message.

  5. ChaptarrNG was reachable. Its API reported 7,813 ebook records, including 912 with ebook files. SeerrNG’s database contained many ebook records marked available. The underlying library data was present.

Workaround applied to this installation

  • The persistent SeerrNG startup script routes the Books Available view to /api/v1/book/library and sends only the supported format parameter.
  • Automatic pagination on the Books discovery page is disabled to prevent another request burst.
  • A separate My Bookshelf page was added with explicit Load more paging.
  • The service-worker cache version was bumped so the browser can receive the updated bundle. SeerrNG was restarted.

These are runtime patches to the deployed container, not changes to the upstream source repository.

Suggested upstream fixes

  • Make the Available filter use the in-library endpoint, with only its supported parameters.
  • Replace 500 ms automatic bottom polling with user-driven or bounded pagination.
  • Handle HTTP 429 distinctly, respect any Retry-After header, and avoid translating rate limits into “Open Library could not be reached.”
  • Back off and coalesce cover requests when Open Library Covers returns 429, rather than continuing to retry at high volume.

Activity

  1. github-actions commented on Nov 22, 2026

    @github-actions

    Possible duplicate detected

    This issue may be a duplicate of the following (detected via semantic similarity + LLM review):

    A maintainer will review this. If this is not a duplicate, no action is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions