[82] update ratings overlay with extra attribute

pull/1549/head
meisnate12 1 year ago
parent af71851647
commit a4315fe642

@ -1 +1 @@
1.19.0-develop81 1.19.0-develop82

@ -102,12 +102,15 @@ templates:
rating<<rating_num>>_style: rating<<rating_num>>_style:
default: "" default: ""
conditions: conditions:
- rating<<rating_num>>_image: [rt_popcorn, rt_tomato, tmdb] - rating<<rating_num>>_image: [rt_popcorn, rt_tomato, tmdb, metacritic, mdb]
value: "%" value: "%"
- rating<<rating_num>>_image: [metacritic, mdb]
value: "0"
- rating<<rating_num>>_image: [letterboxd] - rating<<rating_num>>_image: [letterboxd]
value: "/" value: "/"
rating<<rating_num>>_extra:
default: ""
conditions:
- rating<<rating_num>>_image: [rt_popcorn, rt_tomato, tmdb]
value: "%"
image_extra: image_extra:
default: "" default: ""
conditions: conditions:
@ -451,7 +454,7 @@ templates:
run_definition: <<run_this>> run_definition: <<run_this>>
ignore_blank_results: true ignore_blank_results: true
overlay: overlay:
name: text(<<<<rating<<rating_num>>>>_rating<<rating<<rating_num>>_style>>>>) name: text(<<<<rating<<rating_num>>>>_rating<<rating<<rating_num>>_style>>>><<rating<<rating_num>>_extra>>)
file: <<rating<<rating_num>>_file>> file: <<rating<<rating_num>>_file>>
url: <<rating<<rating_num>>_url>> url: <<rating<<rating_num>>_url>>
git: <<rating<<rating_num>>_git>> git: <<rating<<rating_num>>_git>>

@ -84,32 +84,35 @@ All [Shared Overlay Variables](../overlay_variables) can be appended by `rating1
| `back_radius` | `30` | | `back_radius` | `30` |
| `back_height` | `105` | | `back_height` | `105` |
| Variable | Description & Values | | Variable | Description & Values |
|:-----------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |:-----------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `rating1` | **Description:** Choose the rating to display in rating1.<br>**Values:** `critic`, `audience`, or `user` | | `rating1` | **Description:** Choose the rating to display in rating1.<br>**Values:** `critic`, `audience`, or `user` |
| `rating1_image` | **Description:** Choose the rating image to display in rating1.<br>**Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdb`, or `star` | | `rating1_image` | **Description:** Choose the rating image to display in rating1.<br>**Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdb`, or `star` |
| `rating1_style` | **Description:** Choose the rating number style for rating1.<br>**Values:** <table class="clearTable"><tr><td>Ten Scale</td><td><code>""</code></td><td><code>8.7</code>, <code>9.0</code></td></tr><tr><td>Ten Scale removing <code>.0</code> </td><td><code>"#"</code></td><td><code>8.7</code>, <code>9</code></td></tr><tr><td>Hundred Scale</td><td><code>"0"</code></td><td><code>87</code>, <code>90</code></td></tr><tr><td>Hundred Scale with <code>%</code> </td><td><code>"%"</code></td><td><code>87%</code>, <code>90%</code></td></tr><tr><td>Five Scale</td><td><code>"/"</code></td><td><code>8.6</code> rating in plex will show as <code>4.3</code> on the overlay</td></tr></table> | | `rating1_style` | **Description:** Choose the rating number style for rating1.<br>**Values:** <table class="clearTable"><tr><td>Ten Scale</td><td><code>""</code></td><td><code>8.7</code>, <code>9.0</code></td></tr><tr><td>Ten Scale removing <code>.0</code> </td><td><code>"#"</code></td><td><code>8.7</code>, <code>9</code></td></tr><tr><td>Hundred Scale</td><td><code>"0"</code></td><td><code>87</code>, <code>90</code></td></tr><tr><td>Five Scale</td><td><code>"/"</code></td><td><code>8.6</code> rating in plex will show as <code>4.3</code> on the overlay</td></tr></table> |
| `rating2` | **Description:** Choose the rating to display in rating2.<br>**Values:** `critic`, `audience`, or `user` | | `rating1_extra` | **Description:** Extra text after rating1.<br>**Default:** `%` for `rt_popcorn`, `rt_tomato`, `tmdb`. <br>**Values:** Any Value |
| `rating2_image` | **Description:** Choose the rating image to display in rating2.<br>**Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdb`, or `star` | | `rating2` | **Description:** Choose the rating to display in rating2.<br>**Values:** `critic`, `audience`, or `user` |
| `rating2_style` | **Description:** Choose the rating number style for rating2.<br>**Values:** <table class="clearTable"><tr><td>Ten Scale</td><td><code>""</code></td><td><code>8.7</code>, <code>9.0</code></td></tr><tr><td>Ten Scale removing <code>.0</code> </td><td><code>"#"</code></td><td><code>8.7</code>, <code>9</code></td></tr><tr><td>Hundred Scale</td><td><code>"0"</code></td><td><code>87</code>, <code>90</code></td></tr><tr><td>Hundred Scale with <code>%</code> </td><td><code>"%"</code></td><td><code>87%</code>, <code>90%</code></td></tr><tr><td>Five Scale</td><td><code>"/"</code></td><td><code>8.6</code> rating in plex will show as <code>4.3</code> on the overlay</td></tr></table> | | `rating2_image` | **Description:** Choose the rating image to display in rating2.<br>**Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdb`, or `star` |
| `rating3` | **Description:** Choose the rating to display in rating3.<br>**Values:** `critic`, `audience`, or `user` | | `rating2_style` | **Description:** Choose the rating number style for rating2.<br>**Values:** <table class="clearTable"><tr><td>Ten Scale</td><td><code>""</code></td><td><code>8.7</code>, <code>9.0</code></td></tr><tr><td>Ten Scale removing <code>.0</code> </td><td><code>"#"</code></td><td><code>8.7</code>, <code>9</code></td></tr><tr><td>Hundred Scale</td><td><code>"0"</code></td><td><code>87</code>, <code>90</code></td></tr><tr><td>Five Scale</td><td><code>"/"</code></td><td><code>8.6</code> rating in plex will show as <code>4.3</code> on the overlay</td></tr></table> |
| `rating3_image` | **Description:** Choose the rating image to display in rating3.<br>**Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdb`, or `star` | | `rating2_extra` | **Description:** Extra text after rating2.<br>**Default:** `%` for `rt_popcorn`, `rt_tomato`, `tmdb`. <br>**Values:** Any Value |
| `rating3_style` | **Description:** Choose the rating number style for rating3.<br>**Values:** <table class="clearTable"><tr><td>Ten Scale</td><td><code>""</code></td><td><code>8.7</code>, <code>9.0</code></td></tr><tr><td>Ten Scale removing <code>.0</code> </td><td><code>"#"</code></td><td><code>8.7</code>, <code>9</code></td></tr><tr><td>Hundred Scale</td><td><code>"0"</code></td><td><code>87</code>, <code>90</code></td></tr><tr><td>Hundred Scale with <code>%</code> </td><td><code>"%"</code></td><td><code>87%</code>, <code>90%</code></td></tr><tr><td>Five Scale</td><td><code>"/"</code></td><td><code>8.6</code> rating in plex will show as <code>4.3</code> on the overlay</td></tr></table> | | `rating3` | **Description:** Choose the rating to display in rating3.<br>**Values:** `critic`, `audience`, or `user` |
| `horizontal_position` | **Description:** Choose the horizontal position for the rating group.<br>**Default:** `left`<br>**Values:** `left`, `right`, or `center` | | `rating3_image` | **Description:** Choose the rating image to display in rating3.<br>**Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdb`, or `star` |
| `vertical_position` | **Description:** Choose the vertical position for the rating group.<br>**Default:** `center`<br>**Values:** `top`, `bottom`, or `center` | | `rating3_style` | **Description:** Choose the rating number style for rating3.<br>**Values:** <table class="clearTable"><tr><td>Ten Scale</td><td><code>""</code></td><td><code>8.7</code>, <code>9.0</code></td></tr><tr><td>Ten Scale removing <code>.0</code> </td><td><code>"#"</code></td><td><code>8.7</code>, <code>9</code></td></tr><tr><td>Hundred Scale</td><td><code>"0"</code></td><td><code>87</code>, <code>90</code></td></tr><tr><td>Five Scale</td><td><code>"/"</code></td><td><code>8.6</code> rating in plex will show as <code>4.3</code> on the overlay</td></tr></table> |
| `rating_alignment` | **Description:** Choose the display alignment for the rating group.<br>**Default:** `vertical`<br>**Values:** `horizontal`, or `vertical` | | `rating3_extra` | **Description:** Extra text after rating3.<br>**Default:** `%` for `rt_popcorn`, `rt_tomato`, `tmdb`. <br>**Values:** Any Value |
| `minimum_rating` | **Description:** Minimum Rating to display<br>**Default:** 0.0<br>**Values:** Any Number | | `horizontal_position` | **Description:** Choose the horizontal position for the rating group.<br>**Default:** `left`<br>**Values:** `left`, `right`, or `center` |
| `fresh_rating` | **Description:** Determines when ratings are considered Fresh<br>**Default:** 6.0<br>**Values:** Any Number | | `vertical_position` | **Description:** Choose the vertical position for the rating group.<br>**Default:** `center`<br>**Values:** `top`, `bottom`, or `center` |
| `maximum_rating` | **Description:** Maximum Rating to display<br>**Default:** 10.0<br>**Values:** Any Number | | `rating_alignment` | **Description:** Choose the display alignment for the rating group.<br>**Default:** `vertical`<br>**Values:** `horizontal`, or `vertical` |
| `font`<sup>1</sup> | **Description:** Choose the font for the Overlay.<br>**Default:** `fonts/Inter-Bold.ttf`<br>**Values:** Path to font file | | `minimum_rating` | **Description:** Minimum Rating to display<br>**Default:** 0.0<br>**Values:** Any Number |
| `font_style`<sup>1</sup> | **Description:** Font style for Variable Fonts.<br>**Values:** Variable Font Style | | `fresh_rating` | **Description:** Determines when ratings are considered Fresh<br>**Default:** 6.0<br>**Values:** Any Number |
| `font_size`<sup>1</sup> | **Description:** Choose the font size for the Overlay.<br>**Default:** `63`<br>**Values:** Any Number greater then 0 | | `maximum_rating` | **Description:** Maximum Rating to display<br>**Default:** 10.0<br>**Values:** Any Number |
| `font_color`<sup>1</sup> | **Description:** Choose the font color for the Overlay.<br>**Default:** `#FFFFFF`<br>**Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA` | | `font`<sup>1</sup> | **Description:** Choose the font for the Overlay.<br>**Default:** `fonts/Inter-Bold.ttf`<br>**Values:** Path to font file |
| `stroke_width`<sup>1</sup> | **Description:** Font Stroke Width for the Text Overlay.<br>**Values:** Any Number greater then 0 | | `font_style`<sup>1</sup> | **Description:** Font style for Variable Fonts.<br>**Values:** Variable Font Style |
| `stroke_color`<sup>1</sup> | **Description:** Font Stroke Color for the Text Overlay.<br>**Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA` | | `font_size`<sup>1</sup> | **Description:** Choose the font size for the Overlay.<br>**Default:** `63`<br>**Values:** Any Number greater then 0 |
| `addon_offset`<sup>1</sup> | **Description:** Text Addon Image Offset from the text.<br>**Default:** `15`<br>**Values:** Any Number greater then 0 | | `font_color`<sup>1</sup> | **Description:** Choose the font color for the Overlay.<br>**Default:** `#FFFFFF`<br>**Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA` |
| `addon_position`<sup>1</sup> | **Description:** Text Addon Image Alignment in relation to the text.<br>**Default:** `left`<br>**Values:** `left`, `right`, `top`, `bottom` | | `stroke_width`<sup>1</sup> | **Description:** Font Stroke Width for the Text Overlay.<br>**Values:** Any Number greater then 0 |
| `builder_level` | **Description:** Choose the Overlay Level.<br>**Values:** `episode` | | `stroke_color`<sup>1</sup> | **Description:** Font Stroke Color for the Text Overlay.<br>**Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA` |
| `addon_offset`<sup>1</sup> | **Description:** Text Addon Image Offset from the text.<br>**Default:** `15`<br>**Values:** Any Number greater then 0 |
| `addon_position`<sup>1</sup> | **Description:** Text Addon Image Alignment in relation to the text.<br>**Default:** `left`<br>**Values:** `left`, `right`, `top`, `bottom` |
| `builder_level` | **Description:** Choose the Overlay Level.<br>**Values:** `episode` |
1. These Variables can be appended by `rating1_`, `rating2_`, or `rating3_` to change that attribute on each rating individually. 1. These Variables can be appended by `rating1_`, `rating2_`, or `rating3_` to change that attribute on each rating individually.

@ -201,9 +201,9 @@ There are multiple Special Text Variables that can be used when formatting the t
| Special Text Variables & Mods | Movies | Shows | Seasons | Episodes | | Special Text Variables & Mods | Movies | Shows | Seasons | Episodes |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:| |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|
| `<<audience_rating>>`: audience rating (`8.7`, `9.0`)<br>`<<audience_rating0>>`: audience rating out of 100 (`87`, `90`)<br>`<<audience_rating%>>`: audience rating out of 100 ending with `%` (`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`) | &#9989; | &#9989; | &#10060; | &#9989; | | `<<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`) | &#9989; | &#9989; | &#10060; | &#9989; |
| `<<critic_rating>>`: critic rating (`8.7`, `9.0`)<br>`<<critic_rating0>>`: critic rating out of 100 (`87`, `90`)<br>`<<critic_rating%>>`: critic rating out of 100 ending with `%` (`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`) | &#9989; | &#9989; | &#10060; | &#9989; | | `<<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`) | &#9989; | &#9989; | &#10060; | &#9989; |
| `<<user_rating>>`: user rating (`8.7`, `9.0`)<br>`<<user_rating0>>`: user rating out of 100 (`87`, `90`)<br>`<<user_rating%>>`: user rating out of 100 ending with `%` (`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`) | &#9989; | &#9989; | &#9989; | &#9989; | | `<<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`) | &#9989; | &#9989; | &#9989; | &#9989; |
| `<<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 | &#9989; | &#9989; | &#9989; | &#9989; | | `<<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 | &#9989; | &#9989; | &#9989; | &#9989; |
| `<<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 | &#10060; | &#10060; | &#9989; | &#9989; | | `<<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 | &#10060; | &#10060; | &#9989; | &#9989; |
| `<<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 | &#10060; | &#10060; | &#10060; | &#9989; | | `<<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 | &#10060; | &#10060; | &#10060; | &#9989; |

@ -34,9 +34,9 @@ var_mods = {
"show_title": ["", "U", "L", "P"], "show_title": ["", "U", "L", "P"],
"season_title": ["", "U", "L", "P"], "season_title": ["", "U", "L", "P"],
"bitrate": ["", "H", "L"], "bitrate": ["", "H", "L"],
"user_rating": ["", "%", "#", "/", "0"], "user_rating": ["", "%", "#", "/"],
"critic_rating": ["", "%", "#", "/", "0"], "critic_rating": ["", "%", "#", "/"],
"audience_rating": ["", "%", "#", "/", "0"], "audience_rating": ["", "%", "#", "/"],
"originally_available": ["", "["], "originally_available": ["", "["],
"runtime": ["", "H", "M"], "runtime": ["", "H", "M"],
"season_number": ["", "W", "WU", "WL", "0", "00"], "season_number": ["", "W", "WU", "WL", "0", "00"],

@ -259,13 +259,11 @@ class Overlays:
else: else:
final_value = int(actual_value / 60000) final_value = int(actual_value / 60000)
elif mod == "%": elif mod == "%":
final_value = f"{int(actual_value * 10)}%" final_value = int(actual_value * 10)
elif mod == "#": elif mod == "#":
final_value = str(actual_value)[:-2] if str(actual_value).endswith(".0") else actual_value final_value = str(actual_value)[:-2] if str(actual_value).endswith(".0") else actual_value
elif mod == "/": elif mod == "/":
final_value = f"{float(actual_value) / 2:.1f}" final_value = f"{float(actual_value) / 2:.1f}"
elif mod == "0" and format_var in ["audience_rating", "critic_rating", "user_rating"]:
final_value = int(actual_value * 10)
elif mod == "W": elif mod == "W":
final_value = num2words(int(actual_value)) final_value = num2words(int(actual_value))
elif mod == "WU": elif mod == "WU":

Loading…
Cancel
Save