-
-
Notifications
You must be signed in to change notification settings - Fork 685
feat(plex): add content filtering for ignored editions and episode titles #2603
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
Rubeanie
wants to merge
5
commits into
seerr-team:develop
Choose a base branch
from
Rubeanie:feature/plex-ignored-editions
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+266
−12
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
faeed44
feat(plex): add ignored editions filter for Plex movie scanning
Rubeanie ded7150
feat(plex): add ignored episode titles filter and extract shared helpers
Rubeanie 3e371d5
feat(plex): add content filtering section heading to Plex settings
Rubeanie 8021e7b
fix(i18n): clarify content filtering tooltip descriptions
Rubeanie 0d494e6
fix(plex): extract filter helpers to shared module, fix TVDB fallback…
Rubeanie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { getSettings } from '@server/lib/settings'; | ||
|
|
||
| export function isIgnoredEdition(editionTitle?: string): boolean { | ||
| if (!editionTitle) return false; | ||
|
|
||
| const ignoredEditions = getSettings().plex.ignoredEditions ?? []; | ||
| return ignoredEditions.some( | ||
| (e) => editionTitle.toLowerCase().trim() === e.toLowerCase().trim() | ||
| ); | ||
| } | ||
|
|
||
| export function isIgnoredEpisode( | ||
| episodeTitle: string | undefined, | ||
| seasonNumber: number, | ||
| episodeNumber: number | ||
| ): boolean { | ||
| const settings = getSettings(); | ||
| const ignoredTitles = settings.plex.ignoredEpisodeTitles ?? []; | ||
| const filterMode = settings.plex.ignoredEpisodeFilterMode ?? 'season'; | ||
|
|
||
| if (ignoredTitles.length === 0) return false; | ||
|
|
||
| const titleMatch = ignoredTitles.some( | ||
| (t) => episodeTitle?.toLowerCase().trim() === t.toLowerCase().trim() | ||
| ); | ||
| if (!titleMatch) return false; | ||
|
|
||
| if (filterMode === 'any') return true; | ||
| if (filterMode === 'season') return seasonNumber === 0; | ||
| if (filterMode === 'seasonAndEpisode') | ||
| return seasonNumber === 0 && episodeNumber === 0; | ||
|
|
||
| return false; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 95
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 96
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 97
🏁 Script executed:
sed -n '390,415p' server/lib/scanners/plex/index.tsRepository: seerr-team/seerr
Length of output: 835
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 98
🏁 Script executed:
sed -n '240,310p' server/lib/scanners/baseScanner.tsRepository: seerr-team/seerr
Length of output: 2265
🏁 Script executed:
sed -n '1,50p' server/lib/scanners/baseScanner.tsRepository: seerr-team/seerr
Length of output: 1274
🏁 Script executed:
sed -n '310,390p' server/lib/scanners/baseScanner.tsRepository: seerr-team/seerr
Length of output: 3360
🏁 Script executed:
rg "getExisting" server/lib/scanners/baseScanner.ts -A 5 -B 2Repository: seerr-team/seerr
Length of output: 807
🏁 Script executed:
rg "availability" server/lib/scanners/ -i --max-count=20Repository: seerr-team/seerr
Length of output: 239
🏁 Script executed:
sed -n '376,420p' server/lib/scanners/baseScanner.tsRepository: seerr-team/seerr
Length of output: 1544
🏁 Script executed:
sed -n '370,390p' server/lib/scanners/plex/index.tsRepository: seerr-team/seerr
Length of output: 710
🏁 Script executed:
rg "processShow|processMedia" server/lib/scanners/plex/index.ts -B 5 -A 2Repository: seerr-team/seerr
Length of output: 335
🏁 Script executed:
sed -n '410,460p' server/lib/scanners/baseScanner.tsRepository: seerr-team/seerr
Length of output: 1652
🏁 Script executed:
rg "mediaRepository.save|mediaRepository.update" server/lib/scanners/baseScanner.ts -B 2 -A 2Repository: seerr-team/seerr
Length of output: 712
🏁 Script executed:
sed -n '350,410p' server/lib/scanners/plex/index.tsRepository: seerr-team/seerr
Length of output: 1956
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 3072
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 1136
🏁 Script executed:
sed -n '455,480p' server/lib/scanners/baseScanner.tsRepository: seerr-team/seerr
Length of output: 1159
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 3025
🏁 Script executed:
rg "this\.getExisting" server/lib/scanners/ -B 2 -A 2Repository: seerr-team/seerr
Length of output: 727
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 1946
🏁 Script executed:
grep -A 20 "class PlexScanner" server/lib/scanners/plex/index.tsRepository: seerr-team/seerr
Length of output: 637
🏁 Script executed:
rg "availability-sync" server/lib -B 5 -A 10Repository: seerr-team/seerr
Length of output: 1807
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 165
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 90
🏁 Script executed:
rg "availability.sync|availabilitySync" server/ -B 5 -A 15Repository: seerr-team/seerr
Length of output: 10499
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 42
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 95
🏁 Script executed:
sed -n '1,100p' server/lib/availabilitySync.tsRepository: seerr-team/seerr
Length of output: 3779
🏁 Script executed:
rg "MediaStatus\." server/lib/availabilitySync.ts -B 2 -A 2Repository: seerr-team/seerr
Length of output: 4020
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 3798
🏁 Script executed:
sed -n '300,450p' server/lib/availabilitySync.tsRepository: seerr-team/seerr
Length of output: 4859
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 1423
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 1546
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 1043
🏁 Script executed:
Repository: seerr-team/seerr
Length of output: 1798
Risk: Skipping
processShowwhen all episodes are filtered leaves stale TV availability in the database.When a show already exists in the database marked as AVAILABLE and a subsequent scan finds
hasAnyEpisodes === false(all episodes filtered by the ignored titles setting),processShowis skipped entirely. This means the show's season statuses and overall availability status are never updated in the database. SinceprocessShowis where season availability is recalculated and media.status is refreshed (lines 455–495 inbaseScanner.ts), skipping it allows stale AVAILABLE/PARTIALLY_AVAILABLE records to persist indefinitely.The
availability-syncjob (scheduled daily) does not address this scenario—it only marks shows as DELETED if they're genuinely missing from the external source, not if all episodes are filtered by user settings.Note: The Sonarr and Jellyfin scanners do not have this guard and always call
processShow, creating inconsistent behavior across scanners.Recommended action: Consider updating the show if it already exists in the database, even when
hasAnyEpisodes === false, so that season and media statuses reflect the current filtered state. ThegetExistingmethod is protected inBaseScanner; confirm the preferred approach within this codebase's patterns.🤖 Prompt for AI Agents