Skip to content

Discover infinite scroll stops after one page when TMDB returns a short page (e.g. sort by Release Date Descending) #3654

Description

@kitchjp

Description

On Discover → Movies, sorting by Release Date Descending shows only ~19 titles and never loads more, while the default Popularity Descending keeps loading indefinitely.

Cause: src/hooks/useDiscover.ts ends the list when the last page has fewer than 20 results:

const isReachingEnd =
  isEmpty ||
  (!!data && (data[data?.length - 1]?.results.length ?? 0) < 20) ||   // <- here
  (!!data && (data[data?.length - 1]?.totalResults ?? 0) <= size * 20) ||
  (!!data && (data[data?.length - 1]?.totalResults ?? 0) < 41);

TMDB's /discover/movie does not guarantee 20 results per page. With sort_by=release_date.desc it regularly returns 19 on a page (measured on 3.5.1, pages 1-15: 19,20,20,20,19,20,...; popularity: 20 on all 15), while total_pages is 1000 and total_results 20000. One short page makes the client believe it reached the end, so the list stops after page 1 (or wherever the first short page falls). The same applies to any discover slider/sort whose TMDB page comes back short.

Expected: keep paging until page >= totalPages.

Suggested fix: decide the end from the page counter, not the page size, e.g.

(!!data && (data[data.length - 1]?.page ?? 0) >= (data[data.length - 1]?.totalPages ?? 0))

in place of the results.length < 20 clause. The existing de-duplication (resultIds) already copes with overlapping pages. (Related history: #1649 adjusted the same end-of-pagination check.)

Version

3.5.1 (ghcr.io/seerr-team/seerr:latest); the check is unchanged on develop

Steps to Reproduce

  1. Go to Discover → Movies
  2. Set Sort to Release Date Descending
  3. Scroll down
  4. No further pages load. GET /api/v1/discover/movies?page=1&sortBy=release_date.desc returns 19 results, so isReachingEnd becomes true and page 2 is never requested.

Screenshots

No response

Logs

Platform

desktop

Database

SQLite (default)

Device

Desktop PC (also reproduces for other household devices, since the check is client-side)

Operating System

Windows 11 (server: Docker on Linux)

Browser

Chrome

Additional Context

Workaround we run meanwhile: server-side, top a short TMDB discover page up to 20 with the first new titles of the next page (the client de-dupes them). With that in place the same sort loads 65+ pages / 1,269+ posters in Chrome instead of stopping at page 1, which confirms the short page is the only trigger. A client-side fix as suggested above would make the workaround unnecessary.

Search Existing Issues

  • Yes, I have searched existing issues.

Code of Conduct

  • I agree to follow Seerr's Code of Conduct

Activity

  1. added
    awaiting triage
    on Oct 27, 2026
  2. added theissue type on Oct 27, 2026
  3. fallenbagel commented on Oct 27, 2026

    @fallenbagel
    Member

    The "< 20" check is a real problem and we'll fix it, but this report reads like AI output, and the explanation it gives is wrong.

    "useDiscover" loads 3 pages up front and only checks the last loaded page, so page 2 is always requested and a short first page doesn't stop the list at around 19 titles. With the page sizes you posted, it would stop after page 5. Your repro steps describe what the AI assumed the code does, not what you actually observed.

    This is exactly why we don't want AI-generated bug reports. We don't need you to diagnose the issue, walk us through the code or suggest a fix. That's our job. We need a clear description of what happened, steps to reproduce it, your logs and your setup, written in your own words and submitted through the issue template.

    If you understand what's happening in the code, put that in the Additional Context section. Don't have AI generate a diagnosis for you. That's how you end up with repro steps that don't match the actual behaviour, and it just gives us more work to verify the report before we can even investigate the bug.

    Our AI policy applies to issues too:
    https://github.com/seerr-team/seerr/blob/develop/CONTRIBUTING.md#ai-assistance-notice

    Keep that in mind for future reports.

  4. kitchjp commented on Oct 27, 2026

    @kitchjp
    Author
  5. added 2 commits that reference this issue on Oct 27, 2026
    fcef198
    bd47806
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions