Skip to content

Add user preference for showing adult titles.#1240

Open
gregersn wants to merge 1 commit intoFuzzyGrim:devfrom
gregersn:add-user-setting-for-nsfw-titles
Open

Add user preference for showing adult titles.#1240
gregersn wants to merge 1 commit intoFuzzyGrim:devfrom
gregersn:add-user-setting-for-nsfw-titles

Conversation

@gregersn
Copy link
Copy Markdown

@gregersn gregersn commented Mar 8, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new user-configurable setting that empowers individuals to determine whether adult-rated content is displayed within their search results across various integrated media providers. This enhancement significantly improves user control over content filtering, providing a more personalized and tailored content discovery experience.

Highlights

  • New User Preference: Introduced a new user preference, 'Show adult titles', allowing users to control the visibility of adult content in search results.
  • Search Integration: Integrated the 'Show adult titles' preference into the search functionality of IGDB, MyAnimeList (MAL), and The Movie Database (TMDB) providers.
  • User Interface Update: Added a new toggle switch to the user preferences page for easy management of the 'Show adult titles' setting.
  • Database Schema Change: Implemented a database migration to add a show_adult_titles boolean field to the User model, ensuring the preference is persistently stored.
Changelog
  • src/app/providers/igdb.py
    • Modified the search function signature to accept show_adult_titles.
    • Updated the cache key to include show_adult_titles for accurate caching.
    • Adjusted the IGDB query condition to filter adult themes based on the new preference.
  • src/app/providers/mal.py
    • Modified the search function signature to accept show_adult_titles.
    • Updated the cache key to include show_adult_titles.
    • Modified the MAL API call to include the nsfw parameter based on the new preference.
  • src/app/providers/services.py
    • Modified the main search function signature to accept show_adult_titles as a keyword-only argument.
    • Updated calls to provider-specific search functions (MAL, TMDB, IGDB) to pass the show_adult_titles parameter.
  • src/app/providers/tmdb.py
    • Modified the search function signature to accept show_adult_titles.
    • Updated the cache key to include show_adult_titles.
    • Modified the TMDB API call to include the include_adult parameter based on the new preference.
    • Reformatted get_external_links call in movie function for better readability.
  • src/app/views.py
    • Modified the media_search view to retrieve the show_adult_titles preference from the current user and pass it to the services.search function.
  • src/templates/users/preferences.html
    • Added a new section with a toggle switch for the 'Show adult titles' user preference.
  • src/users/migrations/0051_user_show_adult_titles.py
    • Created a new Django migration to add a show_adult_titles boolean field to the User model, defaulting to False.
  • src/users/models.py
    • Added a show_adult_titles boolean field with a default value of False to the User model.
  • src/users/views.py
    • Updated the preferences view to handle saving the show_adult_titles preference from the user's form submission.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a user preference to show or hide adult-rated titles in search results. The implementation is well-structured, adding the preference to the User model, providing a UI toggle, and correctly plumbing the setting down through the service and provider layers. The logic to conditionally filter content is sound.

I've added one comment regarding the need to update the test suite to reflect the function signature changes, which is a crucial step to ensure the build passes and the application remains stable. Once that is addressed, this PR should be in good shape.

Note: Security Review did not run due to the size of the PR.

Comment thread src/app/providers/services.py Outdated
@gregersn gregersn force-pushed the add-user-setting-for-nsfw-titles branch from 82d18c0 to df9cc4e Compare March 8, 2026 18:52
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