Skip to content

feat: filter out genres in discovery, default user settings #4162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Sn1perdog
Copy link

@Sn1perdog Sn1perdog commented Jun 19, 2025

Description

Using TheMovieDB's without_genres query parameter, we are able to filter out chosen genres out of our search for movies and TV Shows.
Added user settings for both categories, as these have different genres, which automatically gets applied every time the user goes to the Discover pages and when viewing the Popular X.

If a user adds a genre to the (Exclude) Genre, it gets removed from the other one and vice versa.

Screenshot (if UI-related)

image

To-Dos

  • Successful build yarn build
  • Translation keys yarn i18n:extract
  • Database migration (if required)

Issues Fixed or Closed

…fault excluded genres system

Includes user settings for default filtering, discover has automatic filters on these defaults,
Popular X feeds have these filters automatically, adding a filtered genre removes it from genres and
vice versa

implements sct#3293
@sct sct requested a review from Copilot June 19, 2025 22:45
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for default excluded genres in user settings and integrates filterGenre into discovery flows, cleaning up conflicts between included and excluded genres.

  • Extends user settings schema with filterMovieGenresDefault and filterTvGenresDefault
  • Adds UI selectors for default exclusion in user profile and applies defaults in Discover components
  • Propagates filterGenre through query parsing, filter counting, API routes, and TMDB requests

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/hooks/useUser.ts Added new user settings fields for excluded genres
src/context/SettingsContext.tsx Initialized default exclusion settings keys
src/components/UserProfile/UserSettings/UserGeneralSettings/index.tsx Added UI fields for movie/TV genre exclusion
src/components/Settings/SettingsMain/index.tsx Added translation messages for exclusion settings
src/components/Selector/index.tsx Updated GenreSelector to controlled value and handleChange
src/components/Discover/constants.ts Extended filter schema and parsing with filterGenre
src/components/Discover/MovieGenreSlider/index.tsx Slider header updated
src/components/Discover/FilterSlideover/index.tsx Integrated default exclusions and conflict resolution
src/components/Discover/DiscoverTv/index.tsx Applied TV default exclusions to filter count
src/components/Discover/DiscoverMovies/index.tsx Applied movie default exclusions to filter count
server/routes/user/usersettings.ts Exposed new exclusion fields in user settings API
server/routes/discover.ts Added filterGenre handling and conflict resolution
server/lib/settings.ts Added exclusion defaults to main settings model
server/interfaces/api/userSettingsInterfaces.ts Updated user settings response interface
server/interfaces/api/settingsInterfaces.ts Updated public settings interface
server/entity/UserSettings.ts Added DB columns for default excluded genres
server/api/themoviedb/index.ts Wired without_genres (filterGenre) into TMDB calls
overseerr-api.yml Documented filterGenre query parameter
Comments suppressed due to low confidence (2)

src/components/Discover/FilterSlideover/index.tsx:70

  • [nitpick] The variable userDefaultfilterGenres breaks camelCase consistency—consider renaming it to userDefaultFilterGenres.
  const userDefaultfilterGenres =

src/components/Discover/FilterSlideover/index.tsx:197

  • The updated countActiveFilters now considers default exclusions and 'none'. Please add unit tests covering these new scenarios to ensure correctness.
          defaultValue={filterGenresValue}

Sn1perdog and others added 4 commits June 20, 2025 06:59
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.

Discovery Filter - 'Exclude Genre' option and Filter Profiles
1 participant