Skip to content

fix: apply Discover Language filter to network & studio sliders#3229

Open
4jesse wants to merge 1 commit into
seerr-team:developfrom
4jesse:fix/discover-language-network-studio
Open

fix: apply Discover Language filter to network & studio sliders#3229
4jesse wants to merge 1 commit into
seerr-team:developfrom
4jesse:fix/discover-language-network-studio

Conversation

@4jesse

@4jesse 4jesse commented Jul 6, 2026

Copy link
Copy Markdown

Description

The /tv/network/:networkId and /movies/studio/:studioId discover routes construct a bare new TheMovieDb() instead of using createTmdbWithRegionLanguage(req.user) like every other discover route (/movies, /tv, /movies/genre/:id, /tv/genre/:id, etc.).

As a result, the Original Language setting (Settings → General → Discover Language) is silently ignored for network sliders (e.g. the built-in Netflix row, TMDB network 213) and studio sliders, even though the main and genre rows honor it correctly. Non-English-original titles appear in those rows despite the filter being set — e.g. with Discover Language = English, "Human Vapor" (Japanese) shows up in the Netflix slider.

Both affected routes call getDiscoverTv / getDiscoverMovies, which already pass with_original_language to TMDB, so routing them through the region/language-aware client is all that's needed — the filter then applies consistently with the other discover rows. git blame shows the bare client on these routes predates the createTmdbWithRegionLanguage helper, so this looks like an incomplete retrofit rather than intentional behavior.

Scope note: this intentionally does not touch Trending / Search / Similar / Recommended. Those hit TMDB endpoints (/trending/*, /search/*, /movie/{id}/similar, /{id}/recommendations) that don't accept with_original_language, so they can't be filtered server-side without client-side post-filtering — a larger change with different UX tradeoffs, out of scope here. The /keyword/:keywordId/movies route was also left as-is: getMoviesByKeyword isn't a /discover call and doesn't accept the parameter, so swapping its client would be a no-op.

No linked issue.

How Has This Been Tested?

Tested against a live v3.3.0 instance (ghcr.io/seerr-team/seerr) with Discover Language = English (originalLanguage: "en"):

  • Before: GET /api/v1/discover/tv/network/213 (Netflix) returned a mix of original languages — en, ja (incl. "Human Vapor"), ko, es, zu.
  • After: the same endpoint returns 20/20 English-original titles, matching GET /api/v1/discover/tv (main TV row), and "Human Vapor" no longer appears.
  • Studio route (/movies/studio/:studioId) similarly returns only English-original titles after the change.

Local checks on this branch (Node 22.23.1, pnpm 10.24.0):

  • pnpm typecheck — passes (server + client)
  • pnpm build — succeeds
  • pnpm lint — 0 errors (only pre-existing warnings in unrelated files)
  • pnpm i18n:extract — no translation-key changes

The full unit suite (pnpm test) was not run locally as it needs additional environment setup; the change touches no tested code paths (there are no discover-route tests) and is limited to swapping the TMDB client constructor to the existing helper.

Screenshots / Logs (if applicable)

/api/v1/discover/tv/network/213 original-language tallies, same instance/setting:

before:  1 zu, 2 es, 4 ko, 2 ja (incl. "Human Vapor"), 11 en
after:  20 en

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see below)
  • I have updated the documentation accordingly. (N/A — no user-facing docs affected)
  • All new and existing tests passed. (typecheck/build/lint pass; full test suite not run locally — see above)
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract (no changes)
  • Database migration (if required) (N/A — no schema change)

AI Disclosure: The root-cause investigation and this code change were produced with AI assistance (Claude Code). I reviewed the diagnosis and the diff, verified the behavior against my own live v3.3.0 instance (before/after original-language tallies above), and confirmed pnpm typecheck/build/lint pass locally. The PR description was AI-drafted and edited by me to follow the template. I understand the change and can answer questions about it.

Summary by CodeRabbit

  • Bug Fixes
    • Movie studio and TV network discovery results now respect each user’s region and language preferences, improving localized browsing and search results.

The /tv/network/:networkId and /movies/studio/:studioId discover routes
constructed a bare `new TheMovieDb()` instead of using
`createTmdbWithRegionLanguage(req.user)` like the other discover routes.
As a result the Original Language (Discover Language) setting was ignored
for network sliders (e.g. Netflix) and studio sliders, surfacing content
in languages the user had filtered out.

Both routes call getDiscoverTv/getDiscoverMovies, which pass
with_original_language, so routing them through the region/language-aware
client makes the filter apply consistently with the main and genre rows.
@4jesse 4jesse requested a review from a team as a code owner July 6, 2026 06:47
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ab4b8eb6-e742-4352-9f9b-04442af543b4

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae70d0 and 6cb0155.

📒 Files selected for processing (1)
  • server/routes/discover.ts

📝 Walkthrough

Walkthrough

Two discover route handlers in server/routes/discover.ts—for movie studio and TV network endpoints—now instantiate TheMovieDb using createTmdbWithRegionLanguage(req.user) instead of new TheMovieDb(), applying user-specific region and language settings to TMDB API calls.

Changes

Discover Routes TMDB Initialization

Layer / File(s) Summary
Per-user TMDB initialization
server/routes/discover.ts
Both the /movies/studio/:studioId and /tv/network/:networkId routes now create tmdb via createTmdbWithRegionLanguage(req.user) instead of new TheMovieDb().

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

Two little routes, once plain and bare,
Now hop along with region flair,
A rabbit's tweak, so small and light,
Makes TMDB calls just right! 🐇🌍

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: applying the Discover Language filter to network and studio sliders.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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