From 2da09c8464aca220a37e9814bca879b6aa59e062 Mon Sep 17 00:00:00 2001 From: YozoraXCII <96386153+YozoraXCII@users.noreply.github.com> Date: Fri, 15 Nov 2024 20:53:17 +0000 Subject: [PATCH] [20] Allow Show-level ratings to be used on Seasons (Special Text Overlays) (#2252) --- CHANGELOG | 1 + VERSION | 2 +- docs/files/overlays.md | 49 +++++++++++++++++++++--------------------- modules/overlay.py | 25 ++++++++++----------- 4 files changed, 40 insertions(+), 37 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 71b46d84..fc09d694 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ Update setuptools requirement to 75.3.0 # New Features Added the `character` search option to the `imdb_search` builder +Added ability to use Show-level ratings at the season and episode level for Overlays if the original source does not provide ratings at the season or episode level. This is accomplished using (Special Text Variables)[https://kometa.wiki/en/latest/files/overlays/#special-text-variables] but is not yet available for the `Ratings` Defaults file. Add `show_unfiltered` setting to display items which make it through a filter # Defaults diff --git a/VERSION b/VERSION index c8e74eef..309457ce 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0-build19 +2.1.0-build20 diff --git a/docs/files/overlays.md b/docs/files/overlays.md index 38cf9f38..3492d009 100644 --- a/docs/files/overlays.md +++ b/docs/files/overlays.md @@ -391,31 +391,32 @@ Each Special Text Variables has multiple modifiers that can be used to format th ##### Special Rating Text -| Variable | Description | Item Types | -|:------------------------------|:----------------------------------------|:--------------------------------------------| -| `audience_rating` | Plex Audience Rating | `Movies`, `Shows`, or `Episodes` | -| `critic_rating` | Plex Critic Rating | `Movies`, `Shows`, or `Episodes` | -| `user_rating` | Plex User Rating | `Movies`, `Shows`, `Seasons`, or `Episodes` | -| `tmdb_rating` | TMDb Rating | `Movies`, `Shows`, `Seasons`, or `Episodes` | -| `imdb_rating` | IMDb Rating | `Movies`, `Shows`, or `Episodes` | -| `trakt_user_rating` | Trakt User Rating | `Movies` or `Shows` | -| `omdb_rating` | OMDb Rating | `Movies` or `Shows` | -| `mdb_rating` | MDBList Rating | `Movies` or `Shows` | -| `mdb_average_rating` | MDBList Average Rating | `Movies` or `Shows` | -| `mdb_imdb_rating` | MDBList IMDb Rating | `Movies` or `Shows` | -| `mdb_metacritic_rating` | MDBList Metacritic Rating | `Movies` or `Shows` | -| `mdb_metacriticuser_rating` | MDBList Metacritic User Rating | `Movies` or `Shows` | -| `mdb_trakt_rating` | MDBList Trakt Rating | `Movies` or `Shows` | -| `mdb_tomatoes_rating` | MDBList Rotten Tomatoes Rating | `Movies` or `Shows` | -| `mdb_tomatoesaudience_rating` | MDBList Rotten Tomatoes Audience Rating | `Movies` or `Shows` | -| `mdb_tmdb_rating` | MDBList TMDb Rating | `Movies` or `Shows` | -| `mdb_letterboxd_rating` | MDBList Letterboxd Rating | `Movies` or `Shows` | -| `mdb_myanimelist_rating` | MDBList MyAnimeList Rating | `Movies` or `Shows` | -| `anidb_rating` | AniDB Rating | `Movies` or `Shows` | -| `anidb_average_rating` | AniDB Average Rating | `Movies` or `Shows` | -| `anidb_score_rating` | AniDB Score Rating | `Movies` or `Shows` | -| `mal_rating` | MyAnimeList Rating | `Movies` or `Shows` | +| Variable | Description | Item Types | +|:------------------------------|:----------------------------------------|:--------------------------------------------------------------------------| +| `audience_rating` | Plex Audience Rating | `Movies`, `Shows`, or `Episodes` | +| `critic_rating` | Plex Critic Rating | `Movies`, `Shows`, or `Episodes` | +| `user_rating` | Plex User Rating | `Movies`, `Shows`, `Seasons`, or `Episodes` | +| `tmdb_rating` | TMDb Rating | `Movies`, `Shows`, `Seasons`, or `Episodes` | +| `imdb_rating` | IMDb Rating | `Movies`, `Shows`, `Seasons`1, or `Episodes` | +| `trakt_user_rating` | Trakt User Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `omdb_rating` | OMDb Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_rating` | MDBList Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_average_rating` | MDBList Average Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_imdb_rating` | MDBList IMDb Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_metacritic_rating` | MDBList Metacritic Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_metacriticuser_rating` | MDBList Metacritic User Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_trakt_rating` | MDBList Trakt Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_tomatoes_rating` | MDBList Rotten Tomatoes Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_tomatoesaudience_rating` | MDBList Rotten Tomatoes Audience Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_tmdb_rating` | MDBList TMDb Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_letterboxd_rating` | MDBList Letterboxd Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `mdb_myanimelist_rating` | MDBList MyAnimeList Rating | `Movies`, `Shows`, `Seasons`1 or `Episodes`1 | +| `anidb_rating` | AniDB Rating | `Movies` or `Shows` | +| `anidb_average_rating` | AniDB Average Rating | `Movies` or `Shows` | +| `anidb_score_rating` | AniDB Score Rating | `Movies` or `Shows` | +| `mal_rating` | MyAnimeList Rating | `Movies` or `Shows` | +1 These services do not store season or episode-level ratings, using these options will allow show ratings to be applied at the season or episode level. ??? tip "Special Rating Text Modifiers" diff --git a/modules/overlay.py b/modules/overlay.py index 30bfabe5..392b6d75 100644 --- a/modules/overlay.py +++ b/modules/overlay.py @@ -22,22 +22,23 @@ float_vars = ["audience_rating", "critic_rating", "user_rating"] + rating_source int_vars = ["runtime", "total_runtime", "season_number", "episode_number", "episode_count", "versions"] date_vars = ["originally_available"] types_for_var = { - "movie_show_season_episode_artist_album": ["runtime", "user_rating", "title"], + "movie_show_season_episode_artist_album": ["runtime", "title", "user_rating"], "movie_show_episode_album": ["critic_rating", "originally_available"], - "movie_show_season_episode": ["tmdb_rating"], - "show_season_artist_album": ["total_runtime"], - "movie_show_episode": ["audience_rating", "content_rating", "tmdb_rating", "imdb_rating"], - "movie_show": [ - "original_title", "trakt_user_rating", "omdb_rating", "mdb_rating", "mdb_average_rating", "mdb_imdb_rating", - "mdb_metacritic_rating", "mdb_metacriticuser_rating", "mdb_trakt_rating", "mdb_tomatoes_rating", - "mdb_tomatoesaudience_rating", "mdb_tmdb_rating", "mdb_letterboxd_rating", "mdb_myanimelist_rating", - "anidb_rating", "anidb_average_rating", "anidb_score_rating", "mal_rating" + "movie_show_season_episode": [ + "imdb_rating", "mdb_average_rating", "mdb_imdb_rating", "mdb_letterboxd_rating", + "mdb_metacritic_rating", "mdb_metacriticuser_rating", "mdb_rating", + "mdb_tmdb_rating", "mdb_tomatoes_rating", "mdb_tomatoesaudience_rating", + "mdb_trakt_rating", "mdb_myanimelist_rating", "omdb_rating", "tmdb_rating" ], - "movie_episode": ["versions", "bitrate"], - "season_episode": ["show_title", "season_number"], + "movie_show_season": ["original_title", "trakt_user_rating"], + "show_season_artist_album": ["total_runtime"], + "movie_show_episode": ["audience_rating", "content_rating"], + "movie_show": ["anidb_average_rating", "anidb_rating", "anidb_score_rating", "mal_rating"], + "movie_episode": ["bitrate", "versions"], + "season_episode": ["season_number", "show_title"], "show_season": ["episode_count"], "movie": ["edition"], - "episode": ["season_title", "episode_number"] + "episode": ["episode_number", "season_title"] } var_mods = { "bitrate": ["", "H", "L"],