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 13 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

image
image

Settings:

image
image
image

Job:

image

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
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
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.

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