[47] Add new Overlay special text options

This commit is contained in:
meisnate12 2024-03-27 09:33:38 -04:00
parent 5cd1635afc
commit 34ce51631b
7 changed files with 210 additions and 41 deletions

View file

@ -24,7 +24,8 @@ Mass Update operations now can be given a list of sources to fall back on when o
`plex` attributes `clean_bundles`, `empty_trash`, and `optimize` can now take any schedule options to be run only when desired.
Allows users to use the Admin username when specifying playlist users. Thanks @benbou8231!
Allows `verify_ssl` to be set specifically for plex. Thanks @FestiveKyle!
Updated Plex Item Advance Preferences
Updated Plex Item Advance Preferences.
Add new [Overlay Special Text Options](https://metamanager.wiki/en/latest/files/overlays/#special-text-variables) to directly print ratings to overlays without operations.
# Defaults

View file

@ -1 +1 @@
1.20.0-develop46
1.20.0-develop47

View file

@ -322,24 +322,43 @@ You can use the item's metadata to determine the text by adding Special Text Var
There are multiple Special Text Variables that can be used when formatting the text. The variables are defined like so `<<name>>` and some can have modifiers like so `<<name$>>` where `$` is the modifier. The available options are:
| Special Text Variables & Mods | Movies | Shows | Seasons | Episodes |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------:|:------------------------------------------:|:------------------------------------------:|:------------------------------------------:|
| `<<audience_rating>>`: audience rating (`8.7`, `9.0`)<br>`<<audience_rating%>>`: audience rating out of 100 (`87`, `90`)<br>`<<audience_rating#>>`: audience rating removing `.0` as needed (`8.7`, `9`)<br>`<<audience_rating/>>`: audience rating on a 5 point scale (`8.6` shows as `4.3`) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } |
| `<<critic_rating>>`: critic rating (`8.7`, `9.0`)<br>`<<critic_rating%>>`: critic rating out of 100 (`87`, `90`)<br>`<<critic_rating#>>`: critic rating removing `.0` as needed (`8.7`, `9`)<br>`<<critic_rating/>>`: critic rating on a 5 point scale (`8.6` shows as `4.3`) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } |
| `<<user_rating>>`: user rating (`8.7`, `9.0`)<br>`<<user_rating%>>`: user rating out of 100 (`87`, `90`)<br>`<<user_rating#>>`: user rating removing `.0` as needed (`8.7`, `9`)<br>`<<user_rating/>>`: user rating on a 5 point scale (`8.6` shows as `4.3`) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } |
| `<<title>>`: Title of the Item<br>`<<titleU>>`: Uppercase Title of the Item<br>`<<titleL>>`Lowercase Title of the Item<br>`<<titleP>>`Proper Title of the Item | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } |
| `<<show_title>>`: Title of the Item's Show<br>`<<show_itleU>>`: Uppercase Title of the Item's Show<br>`<<show_titleL>>`Lowercase Title of the Item's Show<br>`<<show_titleP>>`Proper Title of the Item's Show | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } |
| `<<season_title>>`: Title of the Item's Season<br>`<<season_titleU>>`: Uppercase Title of the Item's Season<br>`<<season_titleL>>`Lowercase title of the Item's Season<br>`<<season_titleP>>`Proper title of the Item's Season | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } |
| `<<original_title>>`: Original Title of the Item<br>`<<original_titleU>>`: Original Title of the Item<br>`<<original_titleL>>`Lowercase Original Title of the Item<br>`<<original_titleP>>`Proper Original Title of the Item | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } |
| `<<edition>>`: Edition of the Item<br>`<<editionU>>`: Uppercase Edition of the Item<br>`<<editionL>>`Lowercase Edition of the Item<br>`<<editionP>>`Proper Edition of the Item | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } |
| `<<content_rating>>`: Content Rating of the Item<br>`<<content_ratingU>>`: Uppercase Content Rating of the Item<br>`<<content_ratingL>>`Lowercase Content Rating of the Item<br>`<<content_ratingP>>`Proper Content Rating of the Item | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } |
| `<<episode_count>>`: Number of Episodes (`1`)<br>`<<episode_countW>>`: Number of Episodes As Words (`One`)<br>`<<episode_countWU>>`: Number of Episodes As Uppercase Words (`ONE`)<br>`<<episode_countWL>>`: Number of Episodes As Lowercase Words (`one`)<br>`<<episode_count0>>`: Number of Episodes With 10s Padding (`01`)<br>`<<episode_count00>>`: Number of Episodes With 100s Padding (`001`) | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } |
| `<<season_number>>`: Season Number (`1`)<br>`<<season_numberW>>`: Season Number As Words (`One`)<br>`<<season_numberWU>>`: Season Number As Uppercase Words (`ONE`)<br>`<<season_numberWL>>`: Season Number As Lowercase Words (`one`)<br>`<<season_number0>>`: Season Number With 10s Padding (`01`)<br>`<<season_number00>>`: Season Number With 100s Padding (`001`) | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } |
| `<<episode_number>>`: Episode Number (`1`)<br>`<<episode_numberW>>`: Episode Number As Words (`One`)<br>`<<episode_numberWU>>`: Episode Number As Uppercase Words (`One`)<br>`<<episode_numberWL>>`: Episode Number As Lowercase Words (`one`)<br>`<<episode_number0>>`: Episode Number With 10s Padding (`01`)<br>`<<episode_number00>>`: Episode Number With 100s Padding (`001`) | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } |
| `<<versions>>`: Number of Versions of the Item (`1`)<br>`<<versionsW>>`: Number of Versions of the Item As Words (`One`)<br>`<<versionsWO>>`: Number of Versions of the Item As Uppercase Words (`ONE`)<br>`<<versionsWL>>`: Number of Versions of the Item As Words (`one`)<br>`<<versions0>>`: Number of Versions of the Item With 10s Padding (`01`)<br>`<<versions00>>`: Number of Versions of the Item With 100s Padding (`001`) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } |
| `<<runtime>>`: Complete Runtime of the Item in minutes (`150`)<br>`<<runtimeH>>`: Hours in runtime of the Item (`2`)<br>`<<runtimeM>>`: Minutes remaining in the hour in the runtime of the Item (`30`)<br>**Show and Season use average Episode Runtime.** | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } |
| `<<bitrate>>`: Bitrate of the first media file for an item.<br>`<<bitrateH>>`: Bitrate of the media file with the highest bitrate<br>`<<bitrateL>>`: Bitrate of the media file with the lowest bitrate | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } |
| `<<originally_available>>`: Original Available Date of the Item<br>`<<originally_available[FORMAT]>>`: Original Available Date of the Item in the given format. [Format Options](https://strftime.org/) | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-check:{ .green } | :fontawesome-solid-circle-xmark:{ .red } | :fontawesome-solid-circle-check:{ .green } |
| Special Text Variables & Mods | Item Types |
|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------|
| `<<audience_rating>>`: audience rating (`8.7`, `9.0`)<br>`<<audience_rating%>>`: audience rating out of 100 (`87`, `90`)<br>`<<audience_rating#>>`: audience rating removing `.0` as needed (`8.7`, `9`)<br>`<<audience_rating/>>`: audience rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies`, `Shows`, or `Episodes` |
| `<<critic_rating>>`: critic rating (`8.7`, `9.0`)<br>`<<critic_rating%>>`: critic rating out of 100 (`87`, `90`)<br>`<<critic_rating#>>`: critic rating removing `.0` as needed (`8.7`, `9`)<br>`<<critic_rating/>>`: critic rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies`, `Shows`, or `Episodes` |
| `<<user_rating>>`: user rating (`8.7`, `9.0`)<br>`<<user_rating%>>`: user rating out of 100 (`87`, `90`)<br>`<<user_rating#>>`: user rating removing `.0` as needed (`8.7`, `9`)<br>`<<user_rating/>>`: user rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies`, `Shows`, `Seasons`, or `Episodes` |
| `<<tmdb_rating>>`: TMDb rating (`8.7`, `9.0`)<br>`<<tmdb_rating%>>`: TMDb rating out of 100 (`87`, `90`)<br>`<<tmdb_rating#>>`: TMDb rating removing `.0` as needed (`8.7`, `9`)<br>`<<tmdb_rating/>>`: TMDb rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies`, `Shows`, or `Episodes` |
| `<<imdb_rating>>`: IMDb rating (`8.7`, `9.0`)<br>`<<imdb_rating%>>`: IMDb rating out of 100 (`87`, `90`)<br>`<<imdb_rating#>>`: IMDb rating removing `.0` as needed (`8.7`, `9`)<br>`<<imdb_rating/>>`: IMDb rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies`, `Shows`, or `Episodes` |
| `<<trakt_user_rating>>`: Trakt User rating (`8.7`, `9.0`)<br>`<<trakt_user_rating%>>`: Trakt User rating out of 100 (`87`, `90`)<br>`<<trakt_user_rating#>>`: Trakt User rating removing `.0` as needed (`8.7`, `9`)<br>`<<trakt_user_rating/>>`: Trakt User rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<omdb_rating>>`: OMDb rating (`8.7`, `9.0`)<br>`<<omdb_rating%>>`: OMDb rating out of 100 (`87`, `90`)<br>`<<omdb_rating#>>`: OMDb rating removing `.0` as needed (`8.7`, `9`)<br>`<<omdb_rating/>>`: OMDb rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_rating>>`: MDbList rating (`8.7`, `9.0`)<br>`<<mdb_rating%>>`: MDbList rating out of 100 (`87`, `90`)<br>`<<mdb_rating#>>`: MDbList rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_rating/>>`: MDbList rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_average_rating>>`: MDbList Average rating (`8.7`, `9.0`)<br>`<<mdb_average_rating%>>`: MDbList Average rating out of 100 (`87`, `90`)<br>`<<mdb_average_rating#>>`: MDbList Average rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_average_rating/>>`: MDbList Average rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_imdb_rating>>`: MDbList IMDb rating (`8.7`, `9.0`)<br>`<<mdb_imdb_rating%>>`: MDbList IMDb rating out of 100 (`87`, `90`)<br>`<<mdb_imdb_rating#>>`: MDbList IMDb rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_imdb_rating/>>`: MDbList IMDb rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_metacritic_rating>>`: MDbList Metacritic rating (`8.7`, `9.0`)<br>`<<mdb_metacritic_rating%>>`: MDbList Metacritic rating out of 100 (`87`, `90`)<br>`<<mdb_metacritic_rating#>>`: MDbList Metacritic rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_metacritic_rating/>>`: MDbList Metacritic rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_metacriticuser_rating>>`: MDbList Metacritic User rating (`8.7`, `9.0`)<br>`<<mdb_metacriticuser_rating%>>`: MDbList Metacritic User rating out of 100 (`87`, `90`)<br>`<<mdb_metacriticuser_rating#>>`: MDbList Metacritic User rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_metacriticuser_rating/>>`: MDbList Metacritic User rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_trakt_rating>>`: MDbList Trakt rating (`8.7`, `9.0`)<br>`<<mdb_trakt_rating%>>`: MDbList Trakt rating out of 100 (`87`, `90`)<br>`<<mdb_trakt_rating#>>`: MDbList Trakt rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_trakt_rating/>>`: MDbList Trakt rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_tomatoes_rating>>`: MDbList Rotten Tomatoes rating (`8.7`, `9.0`)<br>`<<mdb_tomatoes_rating%>>`: MDbList Rotten Tomatoes rating out of 100 (`87`, `90`)<br>`<<mdb_tomatoes_rating#>>`: MDbList Rotten Tomatoes rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_tomatoes_rating/>>`: MDbList Rotten Tomatoes rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_tomatoesaudience_rating>>`: MDbList Rotten Tomatoes Audience rating (`8.7`, `9.0`)<br>`<<mdb_tomatoesaudience_rating%>>`: MDbList Rotten Tomatoes Audience rating out of 100 (`87`, `90`)<br>`<<mdb_tomatoesaudience_rating#>>`: MDbList Rotten Tomatoes Audience rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_tomatoesaudience_rating/>>`: MDbList Rotten Tomatoes Audience rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_tmdb_rating>>`: MDbList TMDb rating (`8.7`, `9.0`)<br>`<<mdb_tmdb_rating%>>`: MDbList TMDb rating out of 100 (`87`, `90`)<br>`<<mdb_tmdb_rating#>>`: MDbList TMDb rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_tmdb_rating/>>`: MDbList TMDb rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_letterboxd_rating>>`: MDbList Letterboxd rating (`8.7`, `9.0`)<br>`<<mdb_letterboxd_rating%>>`: MDbList Letterboxd rating out of 100 (`87`, `90`)<br>`<<mdb_letterboxd_rating#>>`: MDbList Letterboxd rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_letterboxd_rating/>>`: MDbList Letterboxd rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mdb_myanimelist_rating>>`: MDbList MyAnimeList rating (`8.7`, `9.0`)<br>`<<mdb_myanimelist_rating%>>`: MDbList MyAnimeList rating out of 100 (`87`, `90`)<br>`<<mdb_myanimelist_rating#>>`: MDbList MyAnimeList rating removing `.0` as needed (`8.7`, `9`)<br>`<<mdb_myanimelist_rating/>>`: MDbList MyAnimeList rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<anidb_rating>>`: AniDB rating (`8.7`, `9.0`)<br>`<<anidb_rating%>>`: AniDB rating out of 100 (`87`, `90`)<br>`<<anidb_rating#>>`: AniDB rating removing `.0` as needed (`8.7`, `9`)<br>`<<anidb_rating/>>`: AniDB rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<anidb_average_rating>>`: AniDB Average rating (`8.7`, `9.0`)<br>`<<anidb_average_rating%>>`: AniDB Average rating out of 100 (`87`, `90`)<br>`<<anidb_average_rating#>>`: AniDB Average rating removing `.0` as needed (`8.7`, `9`)<br>`<<anidb_average_rating/>>`: AniDB Average rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<anidb_score_rating>>`: AniDB Score rating (`8.7`, `9.0`)<br>`<<anidb_score_rating%>>`: AniDB Score rating out of 100 (`87`, `90`)<br>`<<anidb_score_rating#>>`: AniDB Score rating removing `.0` as needed (`8.7`, `9`)<br>`<<anidb_score_rating/>>`: AniDB Score rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<mal_rating>>`: MyAnimeList rating (`8.7`, `9.0`)<br>`<<mal_rating%>>`: MyAnimeList rating out of 100 (`87`, `90`)<br>`<<mal_rating#>>`: MyAnimeList rating removing `.0` as needed (`8.7`, `9`)<br>`<<mal_rating/>>`: MyAnimeList rating on a 5 point scale (`8.6` shows as `4.3`) | `Movies` or `Shows` |
| `<<title>>`: Title of the Item<br>`<<titleU>>`: Uppercase Title of the Item<br>`<<titleL>>`: Lowercase Title of the Item<br>`<<titleP>>`: Proper Title of the Item | `Movies`, `Shows`, `Seasons`, or `Episodes` |
| `<<show_title>>`: Title of the Item's Show<br>`<<show_itleU>>`: Uppercase Title of the Item's Show<br>`<<show_titleL>>`: Lowercase Title of the Item's Show<br>`<<show_titleP>>`: Proper Title of the Item's Show | `Seasons` or `Episodes` |
| `<<season_title>>`: Title of the Item's Season<br>`<<season_titleU>>`: Uppercase Title of the Item's Season<br>`<<season_titleL>>`: Lowercase title of the Item's Season<br>`<<season_titleP>>`: Proper title of the Item's Season | `Episodes` |
| `<<original_title>>`: Original Title of the Item<br>`<<original_titleU>>`: Original Title of the Item<br>`<<original_titleL>>`: Lowercase Original Title of the Item<br>`<<original_titleP>>`: Proper Original Title of the Item | `Movies` or `Shows` |
| `<<edition>>`: Edition of the Item<br>`<<editionU>>`: Uppercase Edition of the Item<br>`<<editionL>>`: Lowercase Edition of the Item<br>`<<editionP>>`: Proper Edition of the Item | `Movies` |
| `<<content_rating>>`: Content Rating of the Item<br>`<<content_ratingU>>`: Uppercase Content Rating of the Item<br>`<<content_ratingL>>`: Lowercase Content Rating of the Item<br>`<<content_ratingP>>`: Proper Content Rating of the Item | `Movies`, `Shows`, or `Episodes` |
| `<<episode_count>>`: Number of Episodes (`1`)<br>`<<episode_countW>>`: Number of Episodes As Words (`One`)<br>`<<episode_countWU>>`: Number of Episodes As Uppercase Words (`ONE`)<br>`<<episode_countWL>>`: Number of Episodes As Lowercase Words (`one`)<br>`<<episode_count0>>`: Number of Episodes With 10s Padding (`01`)<br>`<<episode_count00>>`: Number of Episodes With 100s Padding (`001`) | `Shows` or `Seasons` |
| `<<season_number>>`: Season Number (`1`)<br>`<<season_numberW>>`: Season Number As Words (`One`)<br>`<<season_numberWU>>`: Season Number As Uppercase Words (`ONE`)<br>`<<season_numberWL>>`: Season Number As Lowercase Words (`one`)<br>`<<season_number0>>`: Season Number With 10s Padding (`01`)<br>`<<season_number00>>`: Season Number With 100s Padding (`001`) | `Seasons` or `Episodes` |
| `<<episode_number>>`: Episode Number (`1`)<br>`<<episode_numberW>>`: Episode Number As Words (`One`)<br>`<<episode_numberWU>>`: Episode Number As Uppercase Words (`One`)<br>`<<episode_numberWL>>`: Episode Number As Lowercase Words (`one`)<br>`<<episode_number0>>`: Episode Number With 10s Padding (`01`)<br>`<<episode_number00>>`: Episode Number With 100s Padding (`001`) | `Episodes` |
| `<<versions>>`: Number of Versions of the Item (`1`)<br>`<<versionsW>>`: Number of Versions of the Item As Words (`One`)<br>`<<versionsWO>>`: Number of Versions of the Item As Uppercase Words (`ONE`)<br>`<<versionsWL>>`: Number of Versions of the Item As Words (`one`)<br>`<<versions0>>`: Number of Versions of the Item With 10s Padding (`01`)<br>`<<versions00>>`: Number of Versions of the Item With 100s Padding (`001`) | `Movies` or `Episodes` |
| `<<runtime>>`: Complete Runtime of the Item in minutes (`150`)<br>`<<runtimeH>>`: Hours in runtime of the Item (`2`)<br>`<<runtimeM>>`: Minutes remaining in the hour in the runtime of the Item (`30`)<br>**Show and Season use average Episode Runtime.** | `Movies`, `Shows`, `Seasons`, or `Episodes` |
| `<<bitrate>>`: Bitrate of the first media file for an item.<br>`<<bitrateH>>`: Bitrate of the media file with the highest bitrate<br>`<<bitrateL>>`: Bitrate of the media file with the lowest bitrate | `Movies` or `Episodes` |
| `<<originally_available>>`: Original Available Date of the Item<br>`<<originally_available[FORMAT]>>`: Original Available Date of the Item in the given format. [Format Options](https://strftime.org/) | `Movies`, `Shows`, or `Episodes` |
???+ tip

View file

@ -166,7 +166,7 @@ class Operations:
_trakt_ratings = None
def trakt_ratings():
nonlocal _trakt_ratings
if _tmdb_obj is None:
if _trakt_ratings is None:
_trakt_ratings = self.config.Trakt.user_ratings(self.library.is_movie)
if not _trakt_ratings:
raise Failed
@ -358,7 +358,7 @@ class Operations:
found_rating = tmdb_obj().vote_average # noqa
elif option == "imdb":
found_rating = self.config.IMDb.get_rating(imdb_id)
elif attribute == "omdb":
elif option == "omdb":
found_rating = omdb_obj().imdb_rating # noqa
elif option == "trakt_user":
_ratings = trakt_ratings()

View file

@ -12,14 +12,25 @@ portrait_dim = (1000, 1500)
landscape_dim = (1920, 1080)
square_dim = (1000, 1000)
old_special_text = [f"{a}{s}" for a in ["audience_rating", "critic_rating", "user_rating"] for s in ["", "0", "%", "#"]]
float_vars = ["audience_rating", "critic_rating", "user_rating"]
rating_sources = [
"tmdb_rating", "imdb_rating", "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"
]
float_vars = ["audience_rating", "critic_rating", "user_rating"] + rating_sources
int_vars = ["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_episode_album": ["critic_rating", "originally_available"],
"movie_show_episode": ["audience_rating", "content_rating"],
"movie_show": ["original_title"],
"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_episode": ["versions", "bitrate"],
"season_episode": ["show_title", "season_number"],
"show_season": ["episode_count"],
@ -27,23 +38,16 @@ types_for_var = {
"episode": ["season_title", "episode_number"]
}
var_mods = {
"title": ["", "U", "L", "P"],
"content_rating": ["", "U", "L", "P"],
"original_title": ["", "U", "L", "P"],
"edition": ["", "U", "L", "P"],
"show_title": ["", "U", "L", "P"],
"season_title": ["", "U", "L", "P"],
"bitrate": ["", "H", "L"],
"user_rating": ["", "%", "#", "/"],
"critic_rating": ["", "%", "#", "/"],
"audience_rating": ["", "%", "#", "/"],
"originally_available": ["", "["],
"runtime": ["", "H", "M"],
"season_number": ["", "W", "WU", "WL", "0", "00"],
"episode_number": ["", "W", "WU", "WL", "0", "00"],
"episode_count": ["", "W", "WU", "WL", "0", "00"],
"versions": ["", "W", "WU", "WL", "0", "00"],
}
for mod in float_vars:
var_mods[mod] = ["", "%", "#", "/"]
for mod in ["title", "content_rating", "original_title", "edition", "show_title", "season_title"]:
var_mods[mod] = ["", "U", "L", "P"]
for mod in ["season_number", "episode_number", "episode_count", "versions"]:
var_mods[mod] = ["", "W", "WU", "WL", "0", "00"]
single_mods = list(set([m for a, ms in var_mods.items() for m in ms if len(m) == 1]))
double_mods = list(set([m for a, ms in var_mods.items() for m in ms if len(m) == 2]))
vars_by_type = {

View file

@ -2,7 +2,7 @@ import os, re
from datetime import datetime
from modules import plex, util, overlay
from modules.builder import CollectionBuilder
from modules.util import Failed, FilterFailed, NonExisting, NotScheduled
from modules.util import Failed, FilterFailed, NonExisting, NotScheduled, LimitReached
from num2words import num2words
from plexapi.exceptions import BadRequest
from plexapi.video import Season, Episode
@ -70,6 +70,23 @@ class Overlays:
if not self.library.remove_overlays:
logger.separator(f"{'Re-' if self.library.reapply_overlays else ''}Applying Overlays for the {self.library.name} Library")
logger.info("")
_trakt_ratings = None
def trakt_ratings():
nonlocal _trakt_ratings
if _trakt_ratings is None:
_trakt_ratings = self.config.Trakt.user_ratings(self.library.is_movie)
if not _trakt_ratings:
raise Failed
return _trakt_ratings
reverse_anidb = {}
for k, v in self.library.anidb_map.items():
reverse_anidb[v] = k
reverse_mal = {}
for k, v in self.library.mal_map.items():
reverse_mal[v] = k
for i, (over_key, (item, over_names)) in enumerate(sorted(key_to_overlays.items(), key=lambda io: self.library.get_item_sort_title(io[1][0])), 1):
item_title = self.library.get_item_sort_title(item, atr="title")
try:
@ -235,6 +252,131 @@ class Overlays:
actual_value = current
elif mod == "L" and current < actual_value:
actual_value = current
elif format_var in overlay.rating_sources:
found_rating = None
try:
tmdb_id, tvdb_id, imdb_id = self.library.get_ids(item)
if format_var == "tmdb_rating":
_item = self.config.TMDb.get_item(item, tmdb_id, tvdb_id, imdb_id, is_movie=self.library.is_movie)
if _item:
found_rating = _item.vote_average
else:
raise Failed(f"No TMDb ID for Guid: {item.guid}")
elif format_var == "imdb_rating":
found_rating = self.config.IMDb.get_rating(imdb_id)
elif format_var == "omdb_rating":
if self.config.OMDb.limit is not False:
raise Failed("Daily OMDb Limit Reached")
elif not imdb_id:
raise Failed(f"No IMDb ID for Guid: {item.guid}")
else:
try:
found_rating = self.config.OMDb.get_omdb(imdb_id).imdb_rating
except Exception:
logger.error(f"IMDb ID: {imdb_id}")
raise
elif format_var == "trakt_user_rating":
_ratings = trakt_ratings()
_id = tmdb_id if self.library.is_movie else tvdb_id
if _id in _ratings:
found_rating = _ratings[_id]
else:
raise Failed("No Trakt User Rating Found")
elif str(format_var).startswith("mdb"):
mdb_item = None
if self.config.Mdblist.limit is False:
if self.library.is_show and tvdb_id:
try:
mdb_item = self.config.Mdblist.get_series(tvdb_id)
except LimitReached as err:
logger.debug(err)
except Failed as err:
logger.error(str(err))
except Exception:
logger.trace(f"TVDb ID: {tvdb_id}")
raise
if self.library.is_movie and tmdb_id:
try:
mdb_item = self.config.Mdblist.get_movie(tmdb_id)
except LimitReached as err:
logger.debug(err)
except Failed as err:
logger.error(str(err))
except Exception:
logger.trace(f"TMDb ID: {tmdb_id}")
raise
if imdb_id and not mdb_item:
try:
mdb_item = self.config.Mdblist.get_imdb(imdb_id)
except LimitReached as err:
logger.debug(err)
except Failed as err:
logger.error(str(err))
except Exception:
logger.trace(f"IMDb ID: {imdb_id}")
raise
if not mdb_item:
raise Failed(f"No MdbItem for {item.title} (Guid: {item.guid})")
if format_var == "mdb_average_rating":
found_rating = mdb_item.average / 10 if mdb_item.average else None
elif format_var == "mdb_imdb_rating":
found_rating = mdb_item.imdb_rating if mdb_item.imdb_rating else None
elif format_var == "mdb_metacritic_rating":
found_rating = mdb_item.metacritic_rating / 10 if mdb_item.metacritic_rating else None
elif format_var == "mdb_metacriticuser_rating":
found_rating = mdb_item.metacriticuser_rating if mdb_item.metacriticuser_rating else None
elif format_var == "mdb_trakt_rating":
found_rating = mdb_item.trakt_rating / 10 if mdb_item.trakt_rating else None
elif format_var == "mdb_tomatoes_rating":
found_rating = mdb_item.tomatoes_rating / 10 if mdb_item.tomatoes_rating else None
elif format_var == "mdb_tomatoesaudience_rating":
found_rating = mdb_item.tomatoesaudience_rating / 10 if mdb_item.tomatoesaudience_rating else None
elif format_var == "mdb_tmdb_rating":
found_rating = mdb_item.tmdb_rating / 10 if mdb_item.tmdb_rating else None
elif format_var == "mdb_letterboxd_rating":
found_rating = mdb_item.letterboxd_rating * 2 if mdb_item.letterboxd_rating else None
elif format_var == "mdb_myanimelist_rating":
found_rating = mdb_item.myanimelist_rating if mdb_item.myanimelist_rating else None
else:
found_rating = mdb_item.score / 10 if mdb_item.score else None
elif str(format_var).startswith(("anidb", "mal")):
anidb_id = None
if item.ratingKey in reverse_anidb:
anidb_id = reverse_anidb[item.ratingKey]
elif tvdb_id in self.config.Convert._tvdb_to_anidb:
anidb_id = self.config.Convert._tvdb_to_anidb[tvdb_id]
elif imdb_id in self.config.Convert._imdb_to_anidb:
anidb_id = self.config.Convert._imdb_to_anidb[imdb_id]
if str(format_var).startswith("anidb"):
if anidb_id:
anidb_obj = self.config.AniDB.get_anime(anidb_id)
if format_var == "anidb_rating_rating":
found_rating = anidb_obj.rating
elif format_var == "anidb_average_rating":
found_rating = anidb_obj.average
elif format_var == "anidb_score_rating":
found_rating = anidb_obj.score
else:
raise Failed(f"No AniDB ID for Guid: {item.guid}")
else:
if item.ratingKey in reverse_mal:
mal_id = reverse_mal[item.ratingKey]
elif not anidb_id:
raise Failed(f"Convert Warning: No AniDB ID to Convert to MyAnimeList ID for Guid: {item.guid}")
elif anidb_id not in self.config.Convert._anidb_to_mal:
raise Failed(f"Convert Warning: No MyAnimeList Found for AniDB ID: {anidb_id} of Guid: {item.guid}")
else:
mal_id = self.config.Convert._anidb_to_mal[anidb_id]
if mal_id:
found_rating = self.config.MyAnimeList.get_anime(mal_id).score
except Failed as err:
logger.error(err)
if found_rating:
actual_value = found_rating
else:
raise Failed(f"No Rating Found for {item_title}")
elif format_var == "runtime" and text_overlay.level in ["show", "season", "artist", "album"]:
if hasattr(item, "duration") and item.duration:
actual_value = item.duration
@ -268,7 +410,8 @@ class Overlays:
elif mod == "%":
final_value = int(actual_value * 10)
elif mod == "#":
final_value = str(actual_value)[:-2] if str(actual_value).endswith(".0") else actual_value
actual_value = f"{actual_value:.1f}"
final_value = actual_value[:-2] if actual_value.endswith(".0") else actual_value
elif mod == "/":
final_value = f"{float(actual_value) / 2:.1f}"
elif mod == "W":
@ -287,6 +430,8 @@ class Overlays:
final_value = str(actual_value).lower()
elif mod == "P":
final_value = str(actual_value).title()
elif format_var in overlay.rating_sources:
final_value = f"{actual_value:.1f}"
else:
final_value = actual_value
if sub_value:

View file

@ -1612,7 +1612,7 @@ class Plex(Library):
if item_type in util.advance_tags_to_edit:
for advance_edit in util.advance_tags_to_edit[item_type]:
key, options = item_advance_keys[f"item_{advance_edit}"]
if advance_edit in self.metadata_backup["exclude"] or not hasattr(item, key):
if advance_edit in self.metadata_backup["exclude"] or not hasattr(item, key) or not getattr(item, key):
continue
keys = {v: k for k, v in options.items()}
if keys[getattr(item, key)] not in ["default", "all", "never"]: