From 3edf67f30fc251e4c109e4a8429594832a439fa4 Mon Sep 17 00:00:00 2001 From: tenshiak <75363841+tenshiak@users.noreply.github.com> Date: Tue, 18 Apr 2023 16:50:26 +0200 Subject: [PATCH 1/4] Update tmdb.py --- modules/tmdb.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/tmdb.py b/modules/tmdb.py index 052d7d38..2ad363ca 100644 --- a/modules/tmdb.py +++ b/modules/tmdb.py @@ -440,6 +440,8 @@ class TMDb: attr = None if filter_attr == "tmdb_vote_count": attr = item.vote_count + elif filter_attr == "tmdb_vote_average": + attr = item.vote_average elif filter_attr == "tmdb_year": attr = item.release_date.year if is_movie else item.first_air_date.year if util.is_number_filter(attr, modifier, filter_data): From 2b05e7120c1b7e084a89afe25f42a3c6a57b6c5e Mon Sep 17 00:00:00 2001 From: tenshiak <75363841+tenshiak@users.noreply.github.com> Date: Tue, 18 Apr 2023 16:55:32 +0200 Subject: [PATCH 2/4] Implement tmdb_vote_average filter --- modules/builder.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/builder.py b/modules/builder.py index 9269b167..b9cc5a44 100644 --- a/modules/builder.py +++ b/modules/builder.py @@ -79,7 +79,7 @@ filters_by_type = { "movie_show_episode_track": ["duration"], "movie_show_artist_album": ["genre"], "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_artist": ["country"], "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] } 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" ] 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_modifiers = ["", ".not", ".before", ".after", ".regex"] 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"] number_modifiers = ["", ".not", ".gt", ".gte", ".lt", ".lte"] special_filters = [ @@ -135,7 +135,7 @@ year_attributes = plex.year_attributes + ["tmdb_year"] number_attributes = plex.number_attributes + ["channels", "height", "width", "tmdb_vote_count"] tag_attributes = plex.tag_attributes 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 smart_invalid = ["collection_order", "builder_level"] smart_only = ["collection_filtering"] From 20cd01ee976b3a58c9cc7624c7278375413e4ada Mon Sep 17 00:00:00 2001 From: tenshiak <75363841+tenshiak@users.noreply.github.com> Date: Tue, 18 Apr 2023 17:03:34 +0200 Subject: [PATCH 3/4] Update docs --- docs/metadata/filters.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/metadata/filters.md b/docs/metadata/filters.md index cb481874..c10f3004 100644 --- a/docs/metadata/filters.md +++ b/docs/metadata/filters.md @@ -191,6 +191,7 @@ Number filters can **NOT** take multiple values. | `audience_rating` | Uses the audience rating attribute to match
`0.0` - `10.0` | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | | `user_rating` | Uses the user rating attribute to match
`0.0` - `10.0` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | `tmdb_vote_count`**[2](#table-annotations)** | Uses the tmdb vote count to match
minimum: `1` | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | +| `tmdb_vote_average`**[2](#table-annotations)** | Uses the tmdb vote average to match
minimum: `0.0` | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | | `plays` | Uses the plays attribute to match
minimum: `1` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | `duration` | Uses the duration attribute to match using minutes
minimum: `0.0` | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | | `channels` | Uses the audio channels attribute to match
minimum: `0` | ✅ | ✅**[1](#table-annotations)** | ✅**[1](#table-annotations)** | ✅ | ❌ | ❌ | ❌ | From 1c55a9567f68a33f25d86d6b1b3727e3dada32d3 Mon Sep 17 00:00:00 2001 From: tenshiak <75363841+tenshiak@users.noreply.github.com> Date: Tue, 18 Apr 2023 17:08:35 +0200 Subject: [PATCH 4/4] docs wording --- docs/metadata/filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/metadata/filters.md b/docs/metadata/filters.md index c10f3004..0f572aa6 100644 --- a/docs/metadata/filters.md +++ b/docs/metadata/filters.md @@ -191,7 +191,7 @@ Number filters can **NOT** take multiple values. | `audience_rating` | Uses the audience rating attribute to match
`0.0` - `10.0` | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | | `user_rating` | Uses the user rating attribute to match
`0.0` - `10.0` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | `tmdb_vote_count`**[2](#table-annotations)** | Uses the tmdb vote count to match
minimum: `1` | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | -| `tmdb_vote_average`**[2](#table-annotations)** | Uses the tmdb vote average to match
minimum: `0.0` | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | +| `tmdb_vote_average`**[2](#table-annotations)** | Uses the tmdb vote average rating to match
minimum: `0.0` | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | | `plays` | Uses the plays attribute to match
minimum: `1` | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | `duration` | Uses the duration attribute to match using minutes
minimum: `0.0` | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ✅ | | `channels` | Uses the audio channels attribute to match
minimum: `0` | ✅ | ✅**[1](#table-annotations)** | ✅**[1](#table-annotations)** | ✅ | ❌ | ❌ | ❌ |