diff --git a/VERSION b/VERSION index c89220d8..1f5743d3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.3-develop18 +1.17.3-develop19 diff --git a/docs/metadata/overlay.md b/docs/metadata/overlay.md index e8487c13..feb89362 100644 --- a/docs/metadata/overlay.md +++ b/docs/metadata/overlay.md @@ -180,11 +180,11 @@ There are multiple Special Text Variables that can be used when formatting the t | `<>`: audience rating (`8.7`, `9.0`)
`<>`: audience rating out of 100 (`87`, `90`)
`<>`: audience rating removing `.0` as needed (`8.7`, `9`)
`<>`: audience rating on a 5 point scale (`8.6` shows as `4.3`) | ✅ | ✅ | ❌ | ✅ | | `<>`: critic rating (`8.7`, `9.0`)
`<>`: critic rating out of 100 (`87`, `90`)
`<>`: critic rating removing `.0` as needed (`8.7`, `9`)
`<>`: critic rating on a 5 point scale (`8.6` shows as `4.3`) | ✅ | ✅ | ❌ | ✅ | | `<>`: user rating (`8.7`, `9.0`)
`<>`: user rating out of 100 (`87`, `90`)
`<>`: user rating removing `.0` as needed (`8.7`, `9`)
`<>`: user rating on a 5 point scale (`8.6` shows as `4.3`) | ✅ | ✅ | ✅ | ✅ | -| `<>`: Title of the Item<br>`<<titleU>>`: Uppercase Title of the Item<br>`<<titleL>>`Lowercase Title of the Item<br>`<<titleT>>`Proper Title of the Item | ✅ | ✅ | ✅ | ✅ | -| `<<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_titleT>>`Proper Title of the Item's Show | ❌ | ❌ | ✅ | ✅ | -| `<<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_titleT>>`Proper title of the Item's Season | ❌ | ❌ | ❌ | ✅ | -| `<<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_titleT>>`Proper Original Title of the Item | ✅ | ✅ | ❌ | ❌ | -| `<<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_ratingT>>`Proper Content Rating of the Item | ✅ | ✅ | ❌ | ✅ | +| `<<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 | ✅ | ✅ | ✅ | ✅ | +| `<<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 | ❌ | ❌ | ✅ | ✅ | +| `<<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 | ❌ | ❌ | ❌ | ✅ | +| `<<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 | ✅ | ✅ | ❌ | ❌ | +| `<<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 | ✅ | ✅ | ❌ | ✅ | | `<<episode_count>>`: Number of Episodes (`1`)<br>`<<episode_countW>>`: Number of Episodes As Words (`One`)<br>`<<episode_count0>>`: Number of Episodes With 10s Padding (`01`)<br>`<<episode_count00>>`: Number of Episodes With 100s Padding (`001`) | ❌ | ✅ | ✅ | ❌ | | `<<season_number>>`: Season Number (`1`)<br>`<<season_numberW>>`: Season Number As Words (`One`)<br>`<<season_number0>>`: Season Number With 10s Padding (`01`)<br>`<<season_number00>>`: Season Number With 100s Padding (`001`) | ❌ | ❌ | ✅ | ✅ | | `<<episode_number>>`: Episode Number (`1`)<br>`<<episode_numberW>>`: Episode Number As Words (`One`)<br>`<<episode_number0>>`: Episode Number With 10s Padding (`01`)<br>`<<episode_number00>>`: Episode Number With 100s Padding (`001`) | ❌ | ❌ | ❌ | ✅ | diff --git a/modules/overlay.py b/modules/overlay.py index 7232a81a..6befec21 100644 --- a/modules/overlay.py +++ b/modules/overlay.py @@ -23,11 +23,11 @@ types_for_var = { "episode": ["season_title", "episode_number"] } var_mods = { - "title": ["", "U", "L", "T"], - "content_rating": ["", "U", "L", "T"], - "original_title": ["", "U", "L", "T"], - "show_title": ["", "U", "L", "T"], - "season_title": ["", "U", "L", "T"], + "title": ["", "U", "L", "P"], + "content_rating": ["", "U", "L", "P"], + "original_title": ["", "U", "L", "P"], + "show_title": ["", "U", "L", "P"], + "season_title": ["", "U", "L", "P"], "user_rating": ["", "%", "#", "/"], "critic_rating": ["", "%", "#", "/"], "audience_rating": ["", "%", "#", "/"], @@ -37,6 +37,8 @@ var_mods = { "episode_number": ["", "W", "0", "00"], "episode_count": ["", "W", "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 = { "movie": [f"{item}{m}" for check, sub in types_for_var.items() for item in sub for m in var_mods[item] if "movie" in check], "show": [f"{item}{m}" for check, sub in types_for_var.items() for item in sub for m in var_mods[item] if "show" in check], diff --git a/modules/overlays.py b/modules/overlays.py index 62cd877f..7c8a502d 100644 --- a/modules/overlays.py +++ b/modules/overlays.py @@ -207,10 +207,10 @@ class Overlays: if f"<<{format_var}" in full_text and format_var == "originally_available[": mod = re.search("<<originally_available\\[(.+)]>>", full_text).group(1) format_var = "originally_available" - elif f"<<{format_var}>>" in full_text and format_var.endswith("00"): - mod = "00" + elif f"<<{format_var}>>" in full_text and format_var.endswith((m for m in overlay.double_mods)): + mod = format_var[-2:] format_var = format_var[:-2] - elif f"<<{format_var}>>" in full_text and format_var.endswith(("%", "#", "H", "M", "0", "/")): + elif f"<<{format_var}>>" in full_text and format_var.endswith((m for m in overlay.single_mods)): mod = format_var[-1] format_var = format_var[:-1] elif f"<<{format_var}>>" in full_text: @@ -259,7 +259,7 @@ class Overlays: final_value = str(actual_value).upper() elif mod == "L": final_value = str(actual_value).lower() - elif mod == "U": + elif mod == "P": final_value = str(actual_value).title() else: final_value = actual_value