mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
[120] add has_stinger
and stinger_rating
filters
This commit is contained in:
parent
b6c1548a06
commit
d87e76e7c4
5 changed files with 45 additions and 25 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
1.18.3-develop119
|
1.18.3-develop120
|
||||||
|
|
|
@ -128,9 +128,10 @@ Boolean Filters have no modifiers.
|
||||||
### Attribute
|
### Attribute
|
||||||
|
|
||||||
| Boolean Filters | Description | Movies | Shows | Seasons | Episodes | Artists | Albums | Track |
|
| Boolean Filters | Description | Movies | Shows | Seasons | Episodes | Artists | Albums | Track |
|
||||||
|:-------------------|:------------------------------------------------------------|:-------:|:-------------------:|:-------------------:|:--------:|:--------:|:--------:|:--------:|
|
|:-------------------|:---------------------------------------------------------------------------------------------------------|:-------:|:-------------------:|:-------------------:|:--------:|:--------:|:--------:|:--------:|
|
||||||
| `has_collection` | Matches every item that has or does not have a collection | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
| `has_collection` | Matches every item that has or does not have a collection | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
||||||
| `has_edition` | Matches every item that has or does not have an edition | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
| `has_edition` | Matches every item that has or does not have an edition | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
||||||
|
| `has_stinger` | Matches every item that has a [media stinger](http://www.mediastinger.com/) (After/During Credits Scene) | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
||||||
| `has_dolby_vision` | Matches every item that has or does not have a dolby vision | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ | ❌ | ❌ | ❌ |
|
| `has_dolby_vision` | Matches every item that has or does not have a dolby vision | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ | ❌ | ❌ | ❌ |
|
||||||
| `has_overlay` | Matches every item that has or does not have an overlay | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
|
| `has_overlay` | Matches every item that has or does not have an overlay | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
|
||||||
|
|
||||||
|
@ -185,7 +186,7 @@ Number filters can **NOT** take multiple values.
|
||||||
### Attribute
|
### Attribute
|
||||||
|
|
||||||
| Number Filters | Description | Movies | Shows | Seasons | Episodes | Artists | Albums | Track |
|
| Number Filters | Description | Movies | Shows | Seasons | Episodes | Artists | Albums | Track |
|
||||||
|:------------------------------------|:---------------------------------------------------------------------|:-------:|:-------------------:|:-------------------:|:--------:|:-------------------:|:-------------------:|:--------:|
|
|:------------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------:|:-------------------:|:-------------------:|:--------:|:-------------------:|:-------------------:|:--------:|
|
||||||
| `year`<sup>3</sup> | Uses the year attribute to match<br>minimum: `1` | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
|
| `year`<sup>3</sup> | Uses the year attribute to match<br>minimum: `1` | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ |
|
||||||
| `tmdb_year`<sup>2</sup><sup>3</sup> | Uses the year on TMDb to match<br>minimum: `1` | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
| `tmdb_year`<sup>2</sup><sup>3</sup> | Uses the year on TMDb to match<br>minimum: `1` | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
||||||
| `critic_rating` | Uses the critic rating attribute to match<br>`0.0` - `10.0` | ✅ | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ |
|
| `critic_rating` | Uses the critic rating attribute to match<br>`0.0` - `10.0` | ✅ | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ |
|
||||||
|
@ -199,6 +200,7 @@ Number filters can **NOT** take multiple values.
|
||||||
| `width` | Uses the width attribute to match<br>minimum: `0` | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ | ❌ | ❌ | ❌ |
|
| `width` | Uses the width attribute to match<br>minimum: `0` | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ | ❌ | ❌ | ❌ |
|
||||||
| `aspect` | Uses the aspect attribute to match<br>minimum: `0.0` | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ | ❌ | ❌ | ❌ |
|
| `aspect` | Uses the aspect attribute to match<br>minimum: `0.0` | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ | ❌ | ❌ | ❌ |
|
||||||
| `versions` | Uses the number of versions found to match<br>minimum: `0` | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ |
|
| `versions` | Uses the number of versions found to match<br>minimum: `0` | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ | ✅<sup>1</sup> | ✅<sup>1</sup> | ✅ |
|
||||||
|
| `stinger_rating`<sup>4</sup> | Uses the [media stinger](http://www.mediastinger.com/) rating to match. The media stinger rating is if the after/during credits scene is worth staying for.<br>minimum: `0` | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
||||||
|
|
||||||
<sup>1</sup> Filters using the special `episodes` [filter](#special-filters) with the [default percent](details/definition).
|
<sup>1</sup> Filters using the special `episodes` [filter](#special-filters) with the [default percent](details/definition).
|
||||||
|
|
||||||
|
@ -206,6 +208,8 @@ Number filters can **NOT** take multiple values.
|
||||||
|
|
||||||
<sup>3</sup> You can use `current_year` to have PMM use the current years value. This can be combined with a `-#` at the end to subtract that number of years. i.e. `current-2`
|
<sup>3</sup> You can use `current_year` to have PMM use the current years value. This can be combined with a `-#` at the end to subtract that number of years. i.e. `current-2`
|
||||||
|
|
||||||
|
<sup>4</sup> The actual numbers are pulled from the [PMM-Mediastingers](https://github.com/meisnate12/PMM-Mediastingers) Repo.
|
||||||
|
|
||||||
## Special Filters
|
## Special Filters
|
||||||
|
|
||||||
Special Filters each have their own set of rules for how they're used.
|
Special Filters each have their own set of rules for how they're used.
|
||||||
|
|
|
@ -84,7 +84,7 @@ filters_by_type = {
|
||||||
"show_artist": ["folder"],
|
"show_artist": ["folder"],
|
||||||
"show_season": ["episodes"],
|
"show_season": ["episodes"],
|
||||||
"artist_album": ["tracks"],
|
"artist_album": ["tracks"],
|
||||||
"movie": ["edition", "has_edition"],
|
"movie": ["edition", "has_edition", "stinger_rating", "has_stinger"],
|
||||||
"show": ["seasons", "tmdb_status", "tmdb_type", "origin_country", "network", "first_episode_aired", "last_episode_aired", "last_episode_aired_or_never"],
|
"show": ["seasons", "tmdb_status", "tmdb_type", "origin_country", "network", "first_episode_aired", "last_episode_aired", "last_episode_aired_or_never"],
|
||||||
"artist": ["albums"],
|
"artist": ["albums"],
|
||||||
"album": ["record_label"]
|
"album": ["record_label"]
|
||||||
|
@ -113,12 +113,12 @@ tag_filters = [
|
||||||
"origin_country", "writer", "resolution", "audio_language", "subtitle_language", "tmdb_keyword", "tmdb_genre", "imdb_keyword"
|
"origin_country", "writer", "resolution", "audio_language", "subtitle_language", "tmdb_keyword", "tmdb_genre", "imdb_keyword"
|
||||||
]
|
]
|
||||||
tag_modifiers = ["", ".not", ".regex", ".count_gt", ".count_gte", ".count_lt", ".count_lte"]
|
tag_modifiers = ["", ".not", ".regex", ".count_gt", ".count_gte", ".count_lt", ".count_lte"]
|
||||||
boolean_filters = ["has_collection", "has_edition", "has_overlay", "has_dolby_vision"]
|
boolean_filters = ["has_collection", "has_edition", "has_overlay", "has_dolby_vision", "has_stinger"]
|
||||||
date_filters = ["release", "added", "last_played", "first_episode_aired", "last_episode_aired", "last_episode_aired_or_never"]
|
date_filters = ["release", "added", "last_played", "first_episode_aired", "last_episode_aired", "last_episode_aired_or_never"]
|
||||||
date_modifiers = ["", ".not", ".before", ".after", ".regex"]
|
date_modifiers = ["", ".not", ".before", ".after", ".regex"]
|
||||||
number_filters = [
|
number_filters = [
|
||||||
"year", "tmdb_year", "critic_rating", "audience_rating", "user_rating", "tmdb_vote_count", "plays", "duration",
|
"year", "tmdb_year", "critic_rating", "audience_rating", "user_rating", "tmdb_vote_count", "plays", "duration",
|
||||||
"channels", "height", "width", "aspect", "versions"]
|
"channels", "height", "width", "aspect", "versions", "stinger_rating"]
|
||||||
number_modifiers = ["", ".not", ".gt", ".gte", ".lt", ".lte"]
|
number_modifiers = ["", ".not", ".gt", ".gte", ".lt", ".lte"]
|
||||||
special_filters = [
|
special_filters = [
|
||||||
"history", "episodes", "seasons", "albums", "tracks", "original_language", "original_language.not",
|
"history", "episodes", "seasons", "albums", "tracks", "original_language", "original_language.not",
|
||||||
|
|
|
@ -32,6 +32,7 @@ from retrying import retry
|
||||||
|
|
||||||
logger = util.logger
|
logger = util.logger
|
||||||
|
|
||||||
|
mediastingers_url = "https://raw.githubusercontent.com/meisnate12/PMM-Mediastingers/master/stingers.yml"
|
||||||
sync_modes = {"append": "Only Add Items to the Collection or Playlist", "sync": "Add & Remove Items from the Collection or Playlist"}
|
sync_modes = {"append": "Only Add Items to the Collection or Playlist", "sync": "Add & Remove Items from the Collection or Playlist"}
|
||||||
imdb_label_options = {
|
imdb_label_options = {
|
||||||
"none": "Add IMDb Parental Labels for None, Mild, Moderate, or Severe",
|
"none": "Add IMDb Parental Labels for None, Mild, Moderate, or Severe",
|
||||||
|
@ -121,6 +122,7 @@ class ConfigFile:
|
||||||
logger.info(f"Using {self.config_path} as config")
|
logger.info(f"Using {self.config_path} as config")
|
||||||
logger.clear_errors()
|
logger.clear_errors()
|
||||||
|
|
||||||
|
self._mediastingers = None
|
||||||
self.default_dir = default_dir
|
self.default_dir = default_dir
|
||||||
self.read_only = attrs["read_only"] if "read_only" in attrs else False
|
self.read_only = attrs["read_only"] if "read_only" in attrs else False
|
||||||
self.version = attrs["version"] if "version" in attrs else None
|
self.version = attrs["version"] if "version" in attrs else None
|
||||||
|
@ -1086,3 +1088,9 @@ class ConfigFile:
|
||||||
@retry(stop_max_attempt_number=6, wait_fixed=10000)
|
@retry(stop_max_attempt_number=6, wait_fixed=10000)
|
||||||
def post(self, url, data=None, json=None, headers=None):
|
def post(self, url, data=None, json=None, headers=None):
|
||||||
return self.session.post(url, data=data, json=json, headers=headers)
|
return self.session.post(url, data=data, json=json, headers=headers)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def mediastingers(self):
|
||||||
|
if self._mediastingers is None:
|
||||||
|
self._mediastingers = YAML(input_data=self.get(mediastingers_url).content).data
|
||||||
|
return self._mediastingers
|
||||||
|
|
|
@ -1574,6 +1574,10 @@ class Plex(Library):
|
||||||
filter_check = len(item.collections) > 0
|
filter_check = len(item.collections) > 0
|
||||||
elif filter_attr == "has_edition":
|
elif filter_attr == "has_edition":
|
||||||
filter_check = True if item.edition else False
|
filter_check = True if item.edition else False
|
||||||
|
elif filter_attr == "has_stinger":
|
||||||
|
filter_check = False
|
||||||
|
if item.ratingKey in self.movie_rating_key_map and self.movie_rating_key_map[item.ratingKey] in self.config.mediastingers:
|
||||||
|
filter_check = True
|
||||||
elif filter_attr == "has_overlay":
|
elif filter_attr == "has_overlay":
|
||||||
for label in self.item_labels(item):
|
for label in self.item_labels(item):
|
||||||
if label.tag.lower().endswith(" overlay") or label.tag.lower() == "overlay":
|
if label.tag.lower().endswith(" overlay") or label.tag.lower() == "overlay":
|
||||||
|
@ -1637,6 +1641,10 @@ class Plex(Library):
|
||||||
attr = getattr(media, filter_actual)
|
attr = getattr(media, filter_actual)
|
||||||
if attr and attr > test_number:
|
if attr and attr > test_number:
|
||||||
test_number = attr
|
test_number = attr
|
||||||
|
elif filter_attr == "stinger_rating":
|
||||||
|
test_number = None
|
||||||
|
if item.ratingKey in self.movie_rating_key_map and self.movie_rating_key_map[item.ratingKey] in self.config.mediastingers:
|
||||||
|
test_number = self.config.mediastingers[self.movie_rating_key_map[item.ratingKey]]
|
||||||
elif filter_attr == "versions":
|
elif filter_attr == "versions":
|
||||||
test_number = len(item.media)
|
test_number = len(item.media)
|
||||||
elif filter_attr == "audio_language":
|
elif filter_attr == "audio_language":
|
||||||
|
|
Loading…
Reference in a new issue