[17] add episode_critic_rating and episode_audience_rating options to plex_seach and smart_filter

This commit is contained in:
meisnate12 2022-06-02 15:02:43 -04:00
parent 5fd0162db8
commit 7b2078b54f
4 changed files with 32 additions and 24 deletions

View file

@ -1 +1 @@
1.17.0-develop16
1.17.0-develop17

View file

@ -262,26 +262,28 @@ No number search can take multiple values.
### Number Attributes
| Number Search | Description | Movie<br>Libraries | Show<br>Libraries | Music<br>Libraries |
|:----------------------|:--------------------------------------------------------------------------------------------|:------------------:|:-----------------:|:------------------:|
| `duration` | Uses the duration attribute to match using minutes<br>**Minimum:** `0` | &#9989; | &#10060; | &#10060; |
| `plays` | Uses the plays attribute to match<br>**Minimum:** `0` | &#9989; | &#9989; | &#10060; |
| `episode_plays` | Uses the Episode's plays attribute to match<br>**Minimum:** `0` | &#10060; | &#9989; | &#10060; |
| `critic_rating` | Uses the critic rating attribute to match<br>**Range:** `0.0` - `10.0` | &#9989; | &#9989; | &#10060; |
| `audience_rating` | Uses the audience rating attribute to match<br>**Range:** `0.0` - `10.0` | &#9989; | &#9989; | &#10060; |
| `user_rating` | Uses the user rating attribute to match<br>**Range:** `0.0` - `10.0` | &#9989; | &#9989; | &#10060; |
| `episode_user_rating` | Uses the user rating attribute of the show's episodes to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#9989; | &#10060; |
| `year` | Uses the year attribute to match<br>**Minimum:** `0` | &#9989; | &#9989; | &#10060; |
| `episode_year` | Uses the Episode's year attribute to match<br>**Minimum:** `0` | &#10060; | &#9989; | &#10060; |
| `album_year` | Uses the Album's year attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `album_decade` | Uses the Album's decade attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `album_plays` | Uses the Album's plays attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `track_plays` | Uses the Track's plays attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `track_skips` | Uses the Track's skips attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `artist_user_rating` | Uses the Artist's user rating attribute to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#10060; | &#9989; |
| `album_user_rating` | Uses the Album's user rating attribute to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#10060; | &#9989; |
| `album_critic_rating` | Uses the Album's critic rating attribute to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#10060; | &#9989; |
| `track_user_rating` | Uses the Track's user rating attribute to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#10060; | &#9989; |
| Number Search | Description | Movie<br>Libraries | Show<br>Libraries | Music<br>Libraries |
|:--------------------------|:------------------------------------------------------------------------------------------------|:------------------:|:-----------------:|:------------------:|
| `duration` | Uses the duration attribute to match using minutes<br>**Minimum:** `0` | &#9989; | &#10060; | &#10060; |
| `plays` | Uses the plays attribute to match<br>**Minimum:** `0` | &#9989; | &#9989; | &#10060; |
| `episode_plays` | Uses the Episode's plays attribute to match<br>**Minimum:** `0` | &#10060; | &#9989; | &#10060; |
| `critic_rating` | Uses the critic rating attribute to match<br>**Range:** `0.0` - `10.0` | &#9989; | &#9989; | &#10060; |
| `audience_rating` | Uses the audience rating attribute to match<br>**Range:** `0.0` - `10.0` | &#9989; | &#9989; | &#10060; |
| `user_rating` | Uses the user rating attribute to match<br>**Range:** `0.0` - `10.0` | &#9989; | &#9989; | &#10060; |
| `episode_user_rating` | Uses the user rating attribute of the show's episodes to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#9989; | &#10060; |
| `episode_critic_rating` | Uses the critic rating attribute of the show's episodes to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#9989; | &#10060; |
| `episode_audience_rating` | Uses the audience rating attribute of the show's episodes to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#9989; | &#10060; |
| `year` | Uses the year attribute to match<br>**Minimum:** `0` | &#9989; | &#9989; | &#10060; |
| `episode_year` | Uses the Episode's year attribute to match<br>**Minimum:** `0` | &#10060; | &#9989; | &#10060; |
| `album_year` | Uses the Album's year attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `album_decade` | Uses the Album's decade attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `album_plays` | Uses the Album's plays attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `track_plays` | Uses the Track's plays attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `track_skips` | Uses the Track's skips attribute to match<br>**Minimum:** `0` | &#10060; | &#10060; | &#9989; |
| `artist_user_rating` | Uses the Artist's user rating attribute to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#10060; | &#9989; |
| `album_user_rating` | Uses the Album's user rating attribute to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#10060; | &#9989; |
| `album_critic_rating` | Uses the Album's critic rating attribute to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#10060; | &#9989; |
| `track_user_rating` | Uses the Track's user rating attribute to match<br>**Range:** `0.0` - `10.0` | &#10060; | &#10060; | &#9989; |
## Boolean Searches

View file

@ -731,7 +731,7 @@ class ConfigFile:
error_check("mass_trakt_rating_update", "Trakt")
lib_vars = {}
if "template_variables" in lib and lib["template_variables"] and isinstance(lib["template_variables"], dict):
if lib and "template_variables" in lib and lib["template_variables"] and isinstance(lib["template_variables"], dict):
lib_vars = lib["template_variables"]
try:

View file

@ -25,6 +25,8 @@ search_translation = {
"network": "show.network",
"critic_rating": "rating",
"audience_rating": "audienceRating",
"episode_critic_rating": "episode.rating",
"episode_audience_rating": "episode.audienceRating",
"user_rating": "userRating",
"episode_user_rating": "episode.userRating",
"content_rating": "contentRating",
@ -239,6 +241,8 @@ show_only_searches = [
"episode_last_played", "episode_last_played.not", "episode_last_played.before", "episode_last_played.after",
"episode_plays.gt", "episode_plays.gte", "episode_plays.lt", "episode_plays.lte",
"episode_user_rating.gt", "episode_user_rating.gte", "episode_user_rating.lt", "episode_user_rating.lte",
"episode_critic_rating.gt", "episode_critic_rating.gte", "episode_critic_rating.lt", "episode_critic_rating.lte",
"episode_audience_rating.gt", "episode_audience_rating.gte", "episode_audience_rating.lt", "episode_audience_rating.lte",
"episode_year", "episode_year.not", "episode_year.gt", "episode_year.gte", "episode_year.lt", "episode_year.lte",
"unplayed_episodes", "episode_unplayed", "episode_duplicate", "episode_progress", "episode_unmatched", "show_unmatched",
]
@ -258,8 +262,8 @@ date_modifiers = ["", ".not", ".before", ".after"]
year_attributes = ["decade", "year", "episode_year", "album_year", "album_decade"]
number_attributes = ["plays", "episode_plays", "album_plays", "track_plays", "track_skips"] + year_attributes
float_attributes = [
"user_rating", "episode_user_rating", "critic_rating", "audience_rating", "duration",
"artist_user_rating", "album_user_rating", "album_critic_rating", "track_user_rating"
"user_rating", "episode_user_rating", "critic_rating", "episode_critic_rating", "audience_rating", "episode_audience_rating",
"duration", "artist_user_rating", "album_user_rating", "album_critic_rating", "track_user_rating"
]
number_modifiers = [".gt", ".gte", ".lt", ".lte"]
search_display = {"added": "Date Added", "release": "Release Date", "hdr": "HDR", "progress": "In Progress", "episode_progress": "Episode In Progress"}
@ -779,6 +783,8 @@ class Plex(Library):
logger.warning(f"Plex Warning: {item.title} has no Season 1 Episode 1 ")
elif method == "plex_search":
logger.info(f"Processing {data[1]}")
if self.config.trace_mode:
logger.debug(data[2])
items = self.get_filter_items(data[2])
elif method == "plex_collectionless":
good_collections = []