[80] fix rating overlays

pull/1549/head
meisnate12 1 year ago
parent 7826eeff46
commit d122a6af66

@ -1 +1 @@
1.19.0-develop79
1.19.0-develop80

@ -106,6 +106,8 @@ templates:
value: "%"
- rating<<rating_num>>_image: [metacritic, mdb]
value: "0"
- rating<<rating_num>>_image: [letterboxd]
value: "/"
image_extra:
default: ""
conditions:
@ -449,7 +451,7 @@ templates:
run_definition: <<run_this>>
ignore_blank_results: true
overlay:
name: text(<<rating<<rating_num>>>>_rating<<rating<<rating_num>>_style>>)
name: text(<<<<rating<<rating_num>>>>_rating<<rating<<rating_num>>_style>>>>)
file: <<rating<<rating_num>>_file>>
url: <<rating<<rating_num>>_url>>
git: <<rating<<rating_num>>_git>>

@ -85,16 +85,16 @@ All [Shared Overlay Variables](../overlay_variables) can be appended by `rating1
| `back_height` | `105` |
| Variable | Description & Values |
|:-----------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|:-----------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `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_style` | **Description:** Choose the rating number style for rating1.<br>**Values:** <table><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>"%"</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>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` | **Description:** Choose the rating to display in rating2.<br>**Values:** `critic`, `audience`, or `user` |
| `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_style` | **Description:** Choose the rating number style for rating2.<br>**Values:** <table><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>"%"</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_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> |
| `rating3` | **Description:** Choose the rating to display in rating3.<br>**Values:** `critic`, `audience`, or `user` |
| `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` |
| `rating3_style` | **Description:** Choose the rating number style for rating3.<br>**Values:** <table><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>"%"</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_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> |
| `horizontal_position` | **Description:** Choose the horizontal position for the rating group.<br>**Default:** `left`<br>**Values:** `left`, `right`, or `center` |
| `vertical_position` | **Description:** Choose the vertical position for the rating group.<br>**Default:** `center`<br>**Values:** `top`, `bottom`, or `center` |
| `rating_alignment` | **Description:** Choose the display alignment for the rating group.<br>**Default:** `vertical`<br>**Values:** `horizontal`, or `vertical` |

@ -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 |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:|:--------:|:--------:|:--------:|
| `<<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_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_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; |
| `<<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; |
| `<<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; |
| `<<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; |
| `<<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; |
| `<<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"],
"season_title": ["", "U", "L", "P"],
"bitrate": ["", "H", "L"],
"user_rating": ["", "%", "#", "/"],
"critic_rating": ["", "%", "#", "/"],
"audience_rating": ["", "%", "#", "/"],
"user_rating": ["", "%", "#", "/", "0"],
"critic_rating": ["", "%", "#", "/", "0"],
"audience_rating": ["", "%", "#", "/", "0"],
"originally_available": ["", "["],
"runtime": ["", "H", "M"],
"season_number": ["", "W", "WU", "WL", "0", "00"],

@ -259,9 +259,13 @@ class Overlays:
else:
final_value = int(actual_value / 60000)
elif mod == "%":
final_value = int(actual_value * 10)
final_value = f"{int(actual_value * 10)}%"
elif mod == "#":
final_value = str(actual_value)[:-2] if str(actual_value).endswith(".0") else actual_value
elif mod == "/":
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":
final_value = num2words(int(actual_value))
elif mod == "WU":
@ -272,8 +276,6 @@ class Overlays:
final_value = f"{int(actual_value):02}"
elif mod == "00":
final_value = f"{int(actual_value):03}"
elif mod == "/":
final_value = f"{float(actual_value) / 2:.1f}"
elif mod == "U":
final_value = str(actual_value).upper()
elif mod == "L":

@ -4,7 +4,7 @@ lxml==4.9.3
num2words==0.5.12
pathvalidate==3.1.0
pillow==10.0.0
PlexAPI==4.14.0
PlexAPI==4.15.0
psutil==5.9.5
python-dotenv==1.0.0
requests==2.31.0

Loading…
Cancel
Save