[17] Merge branch 'refs/heads/tenshiak/tmdb_average_vote' into nightly

pull/1391/head
meisnate12 2 years ago
commit 6ef1d0b461

@ -191,6 +191,7 @@ Number filters can **NOT** take multiple values.
| `audience_rating` | Uses the audience rating attribute to match<br> `0.0` - `10.0` | &#9989; | &#9989; | &#10060; | &#9989; | &#10060; | &#10060; | &#10060; | | `audience_rating` | Uses the audience rating attribute to match<br> `0.0` - `10.0` | &#9989; | &#9989; | &#10060; | &#9989; | &#10060; | &#10060; | &#10060; |
| `user_rating` | Uses the user rating attribute to match<br>`0.0` - `10.0` | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | | `user_rating` | Uses the user rating attribute to match<br>`0.0` - `10.0` | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; |
| `tmdb_vote_count`<sup>**[2](#table-annotations)**</sup> | Uses the tmdb vote count to match<br>minimum: `1` | &#9989; | &#9989; | &#10060; | &#10060; | &#10060; | &#10060; | &#10060; | | `tmdb_vote_count`<sup>**[2](#table-annotations)**</sup> | Uses the tmdb vote count to match<br>minimum: `1` | &#9989; | &#9989; | &#10060; | &#10060; | &#10060; | &#10060; | &#10060; |
| `tmdb_vote_average`<sup>**[2](#table-annotations)**</sup> | Uses the tmdb vote average rating to match<br>minimum: `0.0` | &#9989; | &#9989; | &#10060; | &#10060; | &#10060; | &#10060; | &#10060; |
| `plays` | Uses the plays attribute to match<br>minimum: `1` | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | | `plays` | Uses the plays attribute to match<br>minimum: `1` | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; | &#9989; |
| `duration` | Uses the duration attribute to match using minutes<br>minimum: `0.0` | &#9989; | &#9989; | &#10060; | &#9989; | &#10060; | &#10060; | &#9989; | | `duration` | Uses the duration attribute to match using minutes<br>minimum: `0.0` | &#9989; | &#9989; | &#10060; | &#9989; | &#10060; | &#10060; | &#9989; |
| `channels` | Uses the audio channels attribute to match<br>minimum: `0` | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; | &#10060; | &#10060; | &#10060; | | `channels` | Uses the audio channels attribute to match<br>minimum: `0` | &#9989; | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989;<sup>**[1](#table-annotations)**</sup> | &#9989; | &#10060; | &#10060; | &#10060; |

@ -79,7 +79,7 @@ filters_by_type = {
"movie_show_episode_track": ["duration"], "movie_show_episode_track": ["duration"],
"movie_show_artist_album": ["genre"], "movie_show_artist_album": ["genre"],
"movie_show_episode": ["actor", "content_rating", "audience_rating"], "movie_show_episode": ["actor", "content_rating", "audience_rating"],
"movie_show": ["studio", "original_language", "tmdb_vote_count", "tmdb_year", "tmdb_genre", "tmdb_title", "tmdb_keyword", "imdb_keyword"], "movie_show": ["studio", "original_language", "tmdb_vote_count", "tmdb_vote_average", "tmdb_year", "tmdb_genre", "tmdb_title", "tmdb_keyword", "imdb_keyword"],
"movie_episode": ["director", "producer", "writer"], "movie_episode": ["director", "producer", "writer"],
"movie_artist": ["country"], "movie_artist": ["country"],
"show_artist": ["folder"], "show_artist": ["folder"],
@ -100,7 +100,7 @@ filters = {
"track": [item for check, sub in filters_by_type.items() for item in sub if "track" in check] "track": [item for check, sub in filters_by_type.items() for item in sub if "track" in check]
} }
tmdb_filters = [ tmdb_filters = [
"original_language", "origin_country", "tmdb_vote_count", "tmdb_year", "tmdb_keyword", "tmdb_genre", "original_language", "origin_country", "tmdb_vote_count", "tmdb_vote_average", "tmdb_year", "tmdb_keyword", "tmdb_genre",
"first_episode_aired", "last_episode_aired", "last_episode_aired_or_never", "tmdb_status", "tmdb_type", "tmdb_title" "first_episode_aired", "last_episode_aired", "last_episode_aired_or_never", "tmdb_status", "tmdb_type", "tmdb_title"
] ]
imdb_filters = ["imdb_keyword"] imdb_filters = ["imdb_keyword"]
@ -118,7 +118,7 @@ boolean_filters = ["has_collection", "has_edition", "has_overlay", "has_dolby_vi
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", "tmdb_vote_average", "plays", "duration",
"channels", "height", "width", "aspect", "versions", "stinger_rating"] "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 = [
@ -135,7 +135,7 @@ year_attributes = plex.year_attributes + ["tmdb_year"]
number_attributes = plex.number_attributes + ["channels", "height", "width", "tmdb_vote_count"] number_attributes = plex.number_attributes + ["channels", "height", "width", "tmdb_vote_count"]
tag_attributes = plex.tag_attributes tag_attributes = plex.tag_attributes
string_attributes = plex.string_attributes + string_filters string_attributes = plex.string_attributes + string_filters
float_attributes = plex.float_attributes + ["aspect"] float_attributes = plex.float_attributes + ["aspect", "tmdb_vote_average"]
boolean_attributes = plex.boolean_attributes + boolean_filters boolean_attributes = plex.boolean_attributes + boolean_filters
smart_invalid = ["collection_order", "builder_level"] smart_invalid = ["collection_order", "builder_level"]
smart_only = ["collection_filtering"] smart_only = ["collection_filtering"]

@ -440,6 +440,8 @@ class TMDb:
attr = None attr = None
if filter_attr == "tmdb_vote_count": if filter_attr == "tmdb_vote_count":
attr = item.vote_count attr = item.vote_count
elif filter_attr == "tmdb_vote_average":
attr = item.vote_average
elif filter_attr == "tmdb_year": elif filter_attr == "tmdb_year":
attr = item.release_date.year if is_movie else item.first_air_date.year attr = item.release_date.year if is_movie else item.first_air_date.year
if util.is_number_filter(attr, modifier, filter_data): if util.is_number_filter(attr, modifier, filter_data):

Loading…
Cancel
Save