Skip to content
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

feat(blacklist): Automatically add media with blacklisted tags to the blacklist #1306

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

Conversation

benbeauchamp7
Copy link

@benbeauchamp7 benbeauchamp7 commented Jan 25, 2025

Description

This pull request introduces blacktags, which automatically blacklist media based on their tags (keywords). Blacktags are configured on the settings page and processed with the Process Blacktags job, which is configured to run weekly by default.

The job queries discover with each sort option round-robin style, with each sort being queries up to "Limit" times, where limit is configured in the settings just under where tags are entered. This is done so that media is blacklisted as much as possible no matter the sort used on the discover page (I don't want media with blacktags to appear when I sort popularity ascending for example). The default limit is 50 pages, resulting in a maximum of 32,000 blacklist entries per tag (2 media types * 50 pages * 20 entries per page * 16 sort options). The maximum limit is 250, which would cap out at 160,000 entries per tag.

Screenshot (if UI-related)

UI

chrome_XVWinkTagi
chrome_ymiZi0kj1E

Settings:

chrome_CFCZpmFnuH
chrome_pSSdNveEPp
chrome_Q6d25aKuCx

Job:

chrome_Wzg9UWzyce

To-Dos

  • Add copy and paste functionality to keyword setting to allow sharing of blacktag configurations
  • Add blacklist filter to hide media added by blacktag
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)
  • More bugtesting before ready for review

Issues Fixed or Closed

@gauthier-th gauthier-th changed the title feat(blacktags): Automatically add media with blacklisted tags to the blacklist feat(blacklist): Automatically add media with blacklisted tags to the blacklist Jan 25, 2025
@benbeauchamp7 benbeauchamp7 force-pushed the develop branch 2 times, most recently from 6221ba8 to 0d6d2d3 Compare January 26, 2025 21:43
@benbeauchamp7
Copy link
Author

That covers the functionality I was planning to implement. The only request I didn't cover from the original issue is an easy way to enable or disable the feature from the settings with a checkbox. I kind-of implemented a way to easily mass-unblock media by running the job without any blacktags configured, which will drop the blacktagged media.

Hoping to open everything up for review tomorrow night, want to do one last pass for bugs and code review

@gauthier-th
Copy link
Collaborator

Genuine question, I didn't look at the code yet: why do you have to implement it using a job? Why can't this be done the same way as the standard blacklist is done, i.e. dismissing the item when it is displayed if the condition matches?

@benbeauchamp7
Copy link
Author

benbeauchamp7 commented Jan 27, 2025 via email

@benbeauchamp7 benbeauchamp7 marked this pull request as ready for review January 27, 2025 23:29
Copy link
Owner

@fallenbagel fallenbagel left a comment

Choose a reason for hiding this comment

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

@benbeauchamp7 please rename it to blacklistTags

@benbeauchamp7
Copy link
Author

Changed all instances to some form of blacklistedTag. Rebased on top of develop (force push did not alter any previous commits)

@benbeauchamp7
Copy link
Author

benbeauchamp7 commented Feb 3, 2025 via email

Copy link

github-actions bot commented Feb 4, 2025

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@github-actions github-actions bot added the merge conflict Cannot merge due to merge conflicts label Feb 4, 2025
@github-actions github-actions bot removed the merge conflict Cannot merge due to merge conflicts label Feb 4, 2025
@benbeauchamp7
Copy link
Author

Rebased on develop, no code was altered in the rebase

Copy link
Collaborator

@gauthier-th gauthier-th left a comment

Choose a reason for hiding this comment

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

Currently, this will not work when a user search a media that have not been added with the job, i.e. for older movies not present in the discovery sections.
I didn't check if it's possible, but can you think of a convenient way of blacklisting it / hiding it in the search page too?

@benbeauchamp7
Copy link
Author

benbeauchamp7 commented Feb 7, 2025

Thank you for your review!

It looks like Jellyseerr's search uses the /search/multi endpoint here, which unfortunately doesn't have any keyword filtering capabilities. The only way I can think to resolve this is by

  1. Querying every shown tv show/movie's keywords (feels slow and bad)
  2. Increasing the limit setting to hopefully catch those shows

Since the original issue was "my feed's full of the kinda shows I don't want on my TV" I think this sufficiently solves that issue. Is probably worth writing up another issue for the search problem.

@gauthier-th
Copy link
Collaborator

It looks like Jellyseerr's search uses the /search/multi endpoint here, which unfortunately doesn't have any keyword filtering capabilities.

Yep, that's what I was afraid of. I'll look at TMDB forums to see if there is any open issue to add tags in the search response (or create one if there isn't), it would solve our issue.

@gauthier-th
Copy link
Collaborator

Just created a ticket on TMDB forum to ask for the without_keyword filter in the /search endpoint and in the /trending endpoint: https://www.themoviedb.org/talk/67abc9c85bd9fe5057b0a872
The without_keyword filter already exists in the /discover endpoint.

@gauthier-th
Copy link
Collaborator

Tested and worked well for what I tried. A few more tests are welcome though.

@gauthier-th gauthier-th mentioned this pull request Feb 11, 2025
17 tasks
@github-actions github-actions bot added the merge conflict Cannot merge due to merge conflicts label Feb 20, 2025
Copy link

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge conflict Cannot merge due to merge conflicts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Tag-Based Content Filtering System in Blacklist Settings
3 participants