fix: apply Discover Language filter to network & studio sliders#3229
fix: apply Discover Language filter to network & studio sliders#32294jesse wants to merge 1 commit into
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTwo 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. ChangesDiscover Routes TMDB Initialization
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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. Comment |
Description
The
/tv/network/:networkIdand/movies/studio/:studioIddiscover routes construct a barenew TheMovieDb()instead of usingcreateTmdbWithRegionLanguage(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 passwith_original_languageto 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 blameshows the bare client on these routes predates thecreateTmdbWithRegionLanguagehelper, 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 acceptwith_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/moviesroute was also left as-is:getMoviesByKeywordisn't a/discovercall 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"):GET /api/v1/discover/tv/network/213(Netflix) returned a mix of original languages —en,ja(incl. "Human Vapor"),ko,es,zu.20/20English-original titles, matchingGET /api/v1/discover/tv(main TV row), and "Human Vapor" no longer appears./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— succeedspnpm lint— 0 errors (only pre-existing warnings in unrelated files)pnpm i18n:extract— no translation-key changesThe 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/213original-language tallies, same instance/setting:Checklist:
pnpm buildpnpm i18n:extract(no changes)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/lintpass 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