Skip to content

Conversation

@Valtora
Copy link

@Valtora Valtora commented Dec 28, 2025

feat(discover): implement multi-region discovery and filtering

  • Update RegionSelector component to support multi-selection strings (e.g., 'US|GB')
  • Enhance RegionSelector UI to display specific flags and names for multiple selections
  • Update TheMovieDb API to use with_origin_country when multiple regions are selected
  • Implement filterResults helper to manually filter Trending/Upcoming results by both Origin Country and Original Language
  • Fix streamingRegion persistence issue in SettingsMain

Description

This PR implements Multi-Region Discovery and Filtering, allowing users to select multiple countries in the "Discover Region" setting. This ensures that content from all selected regions is visible in Discover, Trending, and Popular feeds.

AI Disclosure

AI was used (Gemini 3 Pro, High, via Antigravity) for code generation and refactoring with heavy human supervision throughout and manual verification of all logic.

Q: Why do I think this was okay in this context?
A: The changes made are relatively simple to the frontend and API logic without interfering with other systems.

Key Changes

  • Frontend RegionSelector:

    • Refactored to support multi-selection (stored as pipe-separated strings, e.g., US|GB).
    • Updated UI to display specific flags and country names for selected regions (e.g., "🇺🇸 United States, 🇬🇧 United Kingdom") instead of a generic count.
    • Implemented logic to handle exclusivity for "All Regions" and "Default" options.
  • Backend TheMovieDb:

    • Updated getDiscoverMovies and getDiscoverTv to use the with_origin_country parameter when multiple regions are selected.
    • Implemented a manual filterResults helper for endpoints that don't support simultaneous region/language filtering (like Trending).
    • "Safe Filter" Logic:
      • TV Shows: Strictly filters by origin country.
      • Movies: Includes movies if they match the origin country OR if the origin country data is missing (common in TMDb for newer entries), preventing over-filtering.
    • Language Filtering: Now manually filters Trending results to respect the originalLanguage setting (e.g., hiding Chinese content when English is selected).
  • Fixes:

    • Settings Persistence: Fixed a bug in SettingsMain where streamingRegion would revert to 'US' on refresh if "All Regions" (empty string) was selected. Changed logical OR (||) to nullish coalescing (??) to correctly handle the empty string value.

How Has This Been Tested?

I have tested this manually in a local development environment and verified with static analysis tools.

Manual Verification

  1. Multi-Selection:
    • Selected "United States" and "United Kingdom" in Settings -> General.
    • Verified that the UI correctly displays "🇺🇸 United States, 🇬🇧 United Kingdom".
    • Reloaded the page to ensure settings persistence (saved as US|GB).
  2. Discover Feeds:
    • Navigated to Discover -> Movies/TV.
    • Confirmed that content from both the US and UK appears.
  3. Trending Logic:
    • Verified that the "Trending" rows on the homepage respect the selected regions.
    • Edge Case: Confirmed that when "Discover Language" is set to "English", foreign content (like Chinese donghua) is correctly filtered out from the Trending list, even if it appears in the raw API response.
  4. Streaming Region Default:
    • Cleared the "Streaming Region" (setting it to "All Regions").
    • Refreshed the page.
    • Verified that it remained "All Regions" instead of reverting to "United States".

Automated Checks

  • Passed pnpm typecheck (Client & Server)
  • Passed pnpm lint

Screenshots / Logs (if applicable)

Screenshot 2025-12-28 125643

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
    • Note: AI was used for code generation and refactoring, with heavy human supervision and manual verification of all logic.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required) - N/A - Not Required

@Valtora Valtora requested a review from a team as a code owner December 28, 2025 14:09
- Update RegionSelector component to support multi-selection strings (e.g., 'US|GB')
- Enhance RegionSelector UI to display specific flags and names for multiple selections
- Update TheMovieDb API to use `with_origin_country` when multiple regions are selected
- Implement `filterResults` helper to manually filter Trending/Upcoming results by both Origin Country and Original Language
- Fix streamingRegion persistence issue in SettingsMain
@Valtora Valtora force-pushed the feature-multi-region-discovery branch from fabb4b5 to d1a7105 Compare December 30, 2025 20:47
@Valtora
Copy link
Author

Valtora commented Jan 2, 2026

Please review and let me know if I need to do anything else, thank you for taking the time to do so.

@fallenbagel
Copy link
Collaborator

Please review and let me know if I need to do anything else, thank you for taking the time to do so.

Seerr is on a feature freeze until next release. New features will be reviewed after release.

@Valtora
Copy link
Author

Valtora commented Jan 3, 2026

@fallenbagel Understood, thank you. I'll leave the PR here for now and come back after release. Good luck to you and team in the meantime, thank you for putting in the work to bring us seerr.

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.

2 participants