-
-
Notifications
You must be signed in to change notification settings - Fork 104
feat: add exclusion list #1272
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
Draft
joemckie
wants to merge
21
commits into
main
Choose a base branch
from
feat/add-exclusion-list
base: main
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.
Draft
feat: add exclusion list #1272
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
11cd53d
chore: add program to di
joemckie 3cee72a
feat: refresh dead host links
joemckie 70edfe9
chore: add retry event
joemckie e0fe832
fix: refresh download url async context
joemckie d938847
chore: tidy up
joemckie 159237e
chore: filter inodes
joemckie 0f00935
chore: tweak exception call
joemckie dfada8a
feat: add base exclusion list
joemckie ea4eb05
chore: change to vfs-based exclusions
joemckie 8131c06
chore: fix exclusion logic
joemckie 0f0e0b5
chore: update log
joemckie 0a12a5b
chore: use set instead of list
joemckie fd0eafa
chore: add exclusions to indexers and scrapers
joemckie 14213e5
fix: mediaitem exclusions
joemckie 240c006
chore: move check
joemckie 99db457
chore: revert unneeded change
joemckie 7bf9a43
Merge branch 'main' into feat/add-exclusion-list
joemckie 5cdf2bd
chore: add infohash exclusions
joemckie 20c8263
chore: move index exclusion check to base fn
joemckie 88d6aaf
chore: remove dead code
joemckie 06ef68e
Merge branch 'main' into feat/add-exclusion-list
joemckie 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
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,42 @@ | ||
| from typing import TYPE_CHECKING | ||
|
|
||
| from program.media.item import Movie, Show | ||
| from program.settings.manager import settings_manager | ||
|
Check failure on line 4 in src/program/utils/exclusions.py
|
||
|
|
||
| if TYPE_CHECKING: | ||
| from program.media.item import MediaItem | ||
|
|
||
|
|
||
| class Exclusions: | ||
| excluded_shows: set[str] | ||
| excluded_movies: set[str] | ||
|
|
||
| def __init__(self): | ||
| excluded_items = settings_manager.settings.filesystem.excluded_items | ||
|
|
||
| self.excluded_movies = excluded_items.movies | ||
| self.excluded_shows = excluded_items.shows | ||
|
|
||
| def is_excluded(self, item: "MediaItem") -> bool: | ||
| is_excluded_movie = self._is_excluded_movie(item) | ||
| is_excluded_show = self._is_excluded_show(item._get_top_parent()) | ||
|
Check failure on line 22 in src/program/utils/exclusions.py
|
||
|
|
||
| return is_excluded_movie or is_excluded_show | ||
|
|
||
| def _is_excluded_show(self, item: Show) -> bool: | ||
| if item.tvdb_id is None: | ||
| return False | ||
|
|
||
| return str(item.tvdb_id) in self.excluded_shows | ||
|
|
||
| def _is_excluded_movie(self, item: Movie) -> bool: | ||
| if item.tmdb_id is None and item.imdb_id is None: | ||
| return False | ||
|
|
||
| return ( | ||
| str(item.tmdb_id) in self.excluded_movies | ||
| or str(item.imdb_id) in self.excluded_movies | ||
| ) | ||
|
|
||
|
|
||
| exclusions = Exclusions() | ||
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.
we could still index but then just set the state to Paused or something.. so if later they decide they want it, they can just unpause it
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.
Scratch this, they could be excluding because its not indexing properly I suppose.