mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
[188] updated languages and versions
This commit is contained in:
parent
1a1966159a
commit
7c733e14b4
6 changed files with 150 additions and 33 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.17.3-develop187
|
||||
1.17.3-develop188
|
||||
|
|
|
@ -14,6 +14,8 @@ external_templates:
|
|||
conditions:
|
||||
- flag_alignment: right
|
||||
value: right
|
||||
- use_subtitles: true
|
||||
value: right
|
||||
final_text:
|
||||
default: <<text>>
|
||||
conditions:
|
||||
|
@ -69,11 +71,17 @@ vars:
|
|||
v0-4: &v0-4 {vertical_offset: 61}
|
||||
v0-5: &v0-5 {vertical_offset: 122}
|
||||
|
||||
v2-1: &v2-1 {vertical_offset: 200}
|
||||
v2-2: &v2-2 {vertical_offset: 261}
|
||||
v2-3: &v2-3 {vertical_offset: 322}
|
||||
v2-4: &v2-4 {vertical_offset: 383}
|
||||
v2-5: &v2-5 {vertical_offset: 444}
|
||||
v2-1: &v2-1 {vertical_offset: 150}
|
||||
v2-2: &v2-2 {vertical_offset: 211}
|
||||
v2-3: &v2-3 {vertical_offset: 272}
|
||||
v2-4: &v2-4 {vertical_offset: 333}
|
||||
v2-5: &v2-5 {vertical_offset: 394}
|
||||
|
||||
v3-1: &v3-1 {vertical_offset: 223}
|
||||
v3-2: &v3-2 {vertical_offset: 284}
|
||||
v3-3: &v3-3 {vertical_offset: 345}
|
||||
v3-4: &v3-4 {vertical_offset: 406}
|
||||
v3-5: &v3-5 {vertical_offset: 467}
|
||||
|
||||
vc-c: &vc-c {vertical_offset: 0}
|
||||
vc-t: &vc-t {vertical_offset: -30}
|
||||
|
@ -99,9 +107,18 @@ vars:
|
|||
queues:
|
||||
flags:
|
||||
default:
|
||||
conditionals:
|
||||
horizontal_position:
|
||||
default: left
|
||||
conditions:
|
||||
- use_subtitles: true
|
||||
value: right
|
||||
vertical_position:
|
||||
default: top3
|
||||
conditions:
|
||||
- overlay_level: episode
|
||||
value: top2
|
||||
position: <<group_alignment>>_<<vertical_position>>_<<horizontal_position>>
|
||||
horizontal_position: left
|
||||
vertical_position: top
|
||||
group_alignment: vertical
|
||||
overlay_limit: 3
|
||||
|
||||
|
@ -121,6 +138,14 @@ queues:
|
|||
vertical_top2_right2: [<<: [*top_right, *v2-1, *h1-2], *v2-2, *v2-3, *v2-4, *v2-5]
|
||||
vertical_top2_right: [<<: [*top_right, *v2-1, *h1-1], *v2-2, *v2-3, *v2-4, *v2-5]
|
||||
|
||||
vertical_top3_left: [<<: [*top_left, *v3-1, *h1-1], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_top3_left2: [<<: [*top_left, *v3-1, *h1-2], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_top3_center_left: [<<: [*top_center, *v3-1, *hc-l], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_top3_center: [<<: [*top_center, *v3-1, *hc-c], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_top3_center_right: [<<: [*top_center, *v3-1, *hc-r], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_top3_right2: [<<: [*top_right, *v3-1, *h1-2], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_top3_right: [<<: [*top_right, *v3-1, *h1-1], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
|
||||
vertical_center_top_left: [<<: [*center_left, *v0-1, *h1-1], *v0-2, *v0-3, *v0-4, *v0-5]
|
||||
vertical_center_top_left2: [<<: [*center_left, *v0-1, *h1-2], *v0-2, *v0-3, *v0-4, *v0-5]
|
||||
vertical_center_top_center_left: [<<: [*center_center, *v0-1, *hc-l], *v0-2, *v0-3, *v0-4, *v0-5]
|
||||
|
@ -145,6 +170,14 @@ queues:
|
|||
vertical_center_bottom_right2: [<<: [*center_right, *v0-1, *h1-2], *v0-2, *v0-3, *v0-4, *v0-5]
|
||||
vertical_center_bottom_right: [<<: [*center_right, *v0-1, *h1-1], *v0-2, *v0-3, *v0-4, *v0-5]
|
||||
|
||||
vertical_bottom3_left: [<<: [*bottom_left, *v3-1, *h1-1], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_bottom3_left2: [<<: [*bottom_left, *v3-1, *h1-2], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_bottom3_center_left: [<<: [*bottom_center, *v3-1, *hc-l], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_bottom3_center: [<<: [*bottom_center, *v3-1, *hc-c], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_bottom3_center_right: [<<: [*bottom_center, *v3-1, *hc-r], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_bottom3_right2: [<<: [*bottom_right, *v3-1, *h1-2], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
vertical_bottom3_right: [<<: [*bottom_right, *v3-1, *h1-1], *v3-2, *v3-3, *v3-4, *v3-5]
|
||||
|
||||
vertical_bottom2_left: [<<: [*bottom_left, *v2-1, *h1-1], *v2-2, *v2-3, *v2-4, *v2-5]
|
||||
vertical_bottom2_left2: [<<: [*bottom_left, *v2-1, *h1-2], *v2-2, *v2-3, *v2-4, *v2-5]
|
||||
vertical_bottom2_center_left: [<<: [*bottom_center, *v2-1, *hc-l], *v2-2, *v2-3, *v2-4, *v2-5]
|
||||
|
@ -178,6 +211,14 @@ queues:
|
|||
horizontal_top2_right2: [<<: [*top_right, *v2-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_top2_right: [<<: [*top_right, *v2-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
|
||||
horizontal_top3_left: [<<: [*top_left, *v3-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_top3_left2: [<<: [*top_left, *v3-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_top3_center_left: [<<: [*top_center, *v3-1, *hc-c], *h0-2, *h0-3, *h0-4, *h0-5]
|
||||
horizontal_top3_center: [<<: [*top_center, *v3-1, *hc-c], *h0-2, *h0-3, *h0-4, *h0-5]
|
||||
horizontal_top3_center_right: [<<: [*top_center, *v3-1, *hc-c], *h0-2, *h0-3, *h0-4, *h0-5]
|
||||
horizontal_top3_right2: [<<: [*top_right, *v3-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_top3_right: [<<: [*top_right, *v3-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
|
||||
horizontal_center_top_left: [<<: [*center_left, *vc-t, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_center_top_left2: [<<: [*center_left, *vc-t, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_center_top_center_left: [<<: [*center_center, *vc-t, *h0-1], *h0-2, *h0-3, *h0-4, *h0-5]
|
||||
|
@ -202,6 +243,14 @@ queues:
|
|||
horizontal_center_bottom_right2: [<<: [*center_right, *vc-b, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_center_bottom_right: [<<: [*center_right, *vc-b, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
|
||||
horizontal_bottom3_left: [<<: [*bottom_left, *v3-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_bottom3_left2: [<<: [*bottom_left, *v3-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_bottom3_center_left: [<<: [*bottom_center, *v3-1, *hc-c], *h0-2, *h0-3, *h0-4, *h0-5]
|
||||
horizontal_bottom3_center: [<<: [*bottom_center, *v3-1, *hc-c], *h0-2, *h0-3, *h0-4, *h0-5]
|
||||
horizontal_bottom3_center_right: [<<: [*bottom_center, *v3-1, *hc-c], *h0-2, *h0-3, *h0-4, *h0-5]
|
||||
horizontal_bottom3_right2: [<<: [*bottom_right, *v3-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_bottom3_right: [<<: [*bottom_right, *v3-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
|
||||
horizontal_bottom2_left: [<<: [*bottom_left, *v2-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_bottom2_left2: [<<: [*bottom_left, *v2-1, *h1-1], *h1-2, *h1-3, *h1-4, *h1-5]
|
||||
horizontal_bottom2_center_left: [<<: [*bottom_center, *v2-1, *hc-c], *h0-2, *h0-3, *h0-4, *h0-5]
|
||||
|
|
|
@ -9,9 +9,22 @@
|
|||
external_templates:
|
||||
pmm: templates
|
||||
template_variables:
|
||||
horizontal_offset: 15
|
||||
horizontal_align: right
|
||||
vertical_offset: 150
|
||||
conditionals:
|
||||
vertical_offset:
|
||||
default: 1050
|
||||
conditions:
|
||||
- overlay_level: episode
|
||||
value: 15
|
||||
horizontal_offset:
|
||||
default: 15
|
||||
conditions:
|
||||
- overlay_level: episode
|
||||
value: 235
|
||||
horizontal_align:
|
||||
default: right
|
||||
conditions:
|
||||
- overlay_level: episode
|
||||
value: center
|
||||
vertical_align: top
|
||||
back_color: "#00000099"
|
||||
back_width: 105
|
||||
|
|
|
@ -130,18 +130,18 @@ All [Shared Overlay Variables](variables) are available with the default values
|
|||
|
||||
| Variable | Description & Values |
|
||||
|:------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `position` | **Description:** Use the Custom Given Queue instead of the the provided Queues.<br>**Values:** List of Coordinates |
|
||||
| `use_subtitles` | **Description:** Controls if the overlay is based on subtitle language instead of audio language.<br>**Values:** `true` to look at subtitle language instead of audio language |
|
||||
| `overlay_level` | **Description:** Choose the Overlay Level.<br>**Values:** `season` or `episode` |
|
||||
| `horizontal_position` | **Description:** Choose the horizontal position for the flag group.<br>**Default:** `left`<br>**Values:** `left`, `left2`, `center`, `center_left`, `center_right`, `right` or `right2` |
|
||||
| `vertical_position` | **Description:** Choose the vertical position for the flag group.<br>**Default:** `top`<br>**Values:** `top`, `top2`, `center`, `center_top`, `center_bottom`, `bottom` or `bottom2` |
|
||||
| `vertical_position` | **Description:** Choose the vertical position for the flag group.<br>**Default:** `top`<br>**Values:** `top`, `top2`, `top3`, `center`, `center_top`, `center_bottom`, `bottom`, `bottom2` or `bottom3` |
|
||||
| `overlay_limit` | **Description:** Choose the number of overlay this queue displays.<br>**Default:** `3`<br>**Values:** `1`, `2`, `3`, `4`, or `5` |
|
||||
| `group_alignment` | **Description:** Choose the display alignment for the flag group.<br>**Default:** `vertical`<br>**Values:** `horizontal`, or `vertical` |
|
||||
| `style` | **Description:** Controls the visual theme of the overlays created.<table class="clearTable"><tr><th>Values:</th></tr><tr><td><code>round</code></td><td>Round Theme</td></tr><tr><td><code>square</code></td><td>Square Theme</td></tr><tr><td><code>half</code></td><td>Square Flag with Round Background</td></tr></table> |
|
||||
| `offset` | **Description:** Controls the offset between the flag and the text.<br>**Default:** `10`<br>**Values:** Any Integer 0 or greater |
|
||||
| `flag_alignment` | **Description:** Controls the flag alignment in the backdrop.<br>**Default:** `left`<br>**Values:** `left` or `right` |
|
||||
| `country_<<key>>`<sup>1</sup> | **Description:** Controls the country image for the Overlay.<br>**Default:** Listed in the [Table](#supported-audiosubtitle-language-flags) above<br>**Values:** [ISO 3166-1 Country Code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) for the flag desired |
|
||||
| `offset` | **Description:** Controls the offset between the flag and the text.<br>**Default:** `10`<br>**Values:** Any Integer 0 or greater |
|
||||
| `use_lowercase` | **Description:** Controls if the overlay display is in lowercase.<br>**Values:** `true` to use lowercase text |
|
||||
| `use_subtitles` | **Description:** Controls if the overlay is based on subtitle language instead of audio language.<br>**Values:** `true` to look at subtitle language instead of audio language |
|
||||
| `overlay_level` | **Description:** Choose the Overlay Level.<br>**Values:** `season` or `episode` |
|
||||
| `position` | **Description:** Use the Custom Given Queue instead of the the provided Queues.<br>**Values:** List of Coordinates |
|
||||
| `country_<<key>>`<sup>1</sup> | **Description:** Controls the country image for the Overlay.<br>**Default:** Listed in the [Table](#supported-audiosubtitle-language-flags) above<br>**Values:** [ISO 3166-1 Country Code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) for the flag desired |
|
||||
| `weight_<<key>>`<sup>1</sup> | **Description:** Controls the weight of the Overlay. Higher numbers have priority.<br>**Values:** Any Number |
|
||||
|
||||
1. Each default overlay has a `key` that when calling to effect a specific collection you must replace `<<key>>` with when calling.
|
||||
|
|
|
@ -34,16 +34,16 @@ Note that the `templates_variables:` section only needs to be used if you do wan
|
|||
|
||||
All [Shared Overlay Variables](variables) are available with the default values below as well as the additional Variables below which can be used to customize the file.
|
||||
|
||||
| Variable | Default |
|
||||
|:--------------------|:-----------:|
|
||||
| `horizontal_offset` | `15` |
|
||||
| `horizontal_align` | `right` |
|
||||
| `vertical_offset` | `150` |
|
||||
| `vertical_align` | `top` |
|
||||
| `back_color` | `#00000099` |
|
||||
| `back_radius` | `30` |
|
||||
| `back_width` | `105` |
|
||||
| `back_height` | `105` |
|
||||
| Variable | Default |
|
||||
|:--------------------|:----------------:|
|
||||
| `horizontal_offset` | `15`/`235` |
|
||||
| `horizontal_align` | `right`/`center` |
|
||||
| `vertical_offset` | `1050`/`15` |
|
||||
| `vertical_align` | `top` |
|
||||
| `back_color` | `#00000099` |
|
||||
| `back_radius` | `30` |
|
||||
| `back_width` | `105` |
|
||||
| `back_height` | `105` |
|
||||
|
||||
| Variable | Description & Values |
|
||||
|:----------------|:--------------------------------------------------------------------------------|
|
||||
|
|
|
@ -336,12 +336,12 @@ class DataFile:
|
|||
logger.debug("")
|
||||
logger.debug(f"Conditional: {con_key}")
|
||||
if not isinstance(con_value, dict):
|
||||
raise Failed(f"{self.data_type} Error: template sub-attribute conditionals is not a dictionary")
|
||||
raise Failed(f"{self.data_type} Error: conditional {con_key} is not a dictionary")
|
||||
final_key = replace_var(con_key, [variables, default])
|
||||
if final_key != con_key:
|
||||
logger.debug(f"Variable: {final_key}")
|
||||
if "conditions" not in con_value:
|
||||
raise Failed(f"{self.data_type} Error: conditions sub-attribute required for conditionals")
|
||||
raise Failed(f"{self.data_type} Error: conditions sub-attribute required")
|
||||
conditions = con_value["conditions"]
|
||||
if isinstance(conditions, dict):
|
||||
conditions = [conditions]
|
||||
|
@ -372,7 +372,6 @@ class DataFile:
|
|||
else:
|
||||
logger.debug(f'Condition {i} Failed: {var_key} "{variables[var_key]}" is "{var_value}"')
|
||||
condition_passed = False
|
||||
break
|
||||
elif var_key in variables:
|
||||
if (isinstance(var_value, list) and variables[var_key] not in var_value) or \
|
||||
(not isinstance(var_value, list) and str(variables[var_key]) != str(var_value)):
|
||||
|
@ -381,7 +380,6 @@ class DataFile:
|
|||
else:
|
||||
logger.debug(f'Condition {i} Failed: {var_key} "{variables[var_key]}" is not "{var_value}"')
|
||||
condition_passed = False
|
||||
break
|
||||
elif var_key in default:
|
||||
if (isinstance(var_value, list) and default[var_key] not in var_value) or \
|
||||
(not isinstance(var_value, list) and str(default[var_key]) != str(var_value)):
|
||||
|
@ -390,11 +388,9 @@ class DataFile:
|
|||
else:
|
||||
logger.debug(f'Condition {i} Failed: {var_key} "{default[var_key]}" is not "{var_value}"')
|
||||
condition_passed = False
|
||||
break
|
||||
else:
|
||||
logger.debug(f"Condition {i} Failed: {var_key} is not a variable provided or a default variable")
|
||||
condition_passed = False
|
||||
break
|
||||
if condition_passed:
|
||||
logger.debug(f'Conditional Variable: {final_key} is "{condition["value"]}"')
|
||||
condition_found = True
|
||||
|
@ -1537,6 +1533,65 @@ class OverlayFile(DataFile):
|
|||
elif k == "overlay_limit":
|
||||
if overlay_limit is None:
|
||||
overlay_limit = util.parse("Config", "overlay_limit", v, datatype="int", default=0, minimum=0)
|
||||
elif k == "conditionals":
|
||||
if not v:
|
||||
raise Failed(f"Queue Error: default sub-attribute conditionals is blank")
|
||||
if not isinstance(v, dict):
|
||||
raise Failed(f"Queue Error: default sub-attribute conditionals is not a dictionary")
|
||||
for con_key, con_value in v.items():
|
||||
if not isinstance(con_value, dict):
|
||||
raise Failed(f"Queue Error: conditional {con_key} is not a dictionary")
|
||||
if "default" not in con_value:
|
||||
raise Failed(f"Queue Error: default sub-attribute required for conditional {con_key}")
|
||||
if "conditions" not in con_value:
|
||||
raise Failed(f"Queue Error: conditions sub-attribute required for conditional {con_key}")
|
||||
conditions = con_value["conditions"]
|
||||
if isinstance(conditions, dict):
|
||||
conditions = [conditions]
|
||||
if not isinstance(conditions, list):
|
||||
raise Failed(f"{self.data_type} Error: conditions sub-attribute must be a list or dictionary")
|
||||
condition_found = False
|
||||
for i, condition in enumerate(conditions, 1):
|
||||
if not isinstance(condition, dict):
|
||||
raise Failed(f"{self.data_type} Error: each condition must be a dictionary")
|
||||
if "value" not in condition:
|
||||
raise Failed(f"{self.data_type} Error: each condition must have a result value")
|
||||
condition_passed = True
|
||||
for var_key, var_value in condition.items():
|
||||
if var_key == "value":
|
||||
continue
|
||||
if var_key.endswith(".exists"):
|
||||
var_value = util.parse(self.data_type, var_key, var_value, datatype="bool", default=False)
|
||||
if (not var_value and var_key[:-7] in temp_vars and temp_vars[var_key[:-7]]) or (var_value and (var_key[:-7] not in temp_vars or not temp_vars[var_key[:-7]])):
|
||||
logger.debug(f"Condition {i} Failed: {var_key}: {'true does not exist' if var_value else 'false exists'}")
|
||||
condition_passed = False
|
||||
elif var_key.endswith(".not"):
|
||||
if (isinstance(var_value, list) and temp_vars[var_key] in var_value) or \
|
||||
(not isinstance(var_value, list) and str(temp_vars[var_key]) == str(var_value)):
|
||||
if isinstance(var_value, list):
|
||||
logger.debug(f'Condition {i} Failed: {var_key} "{temp_vars[var_key]}" in {var_value}')
|
||||
else:
|
||||
logger.debug(f'Condition {i} Failed: {var_key} "{temp_vars[var_key]}" is "{var_value}"')
|
||||
condition_passed = False
|
||||
elif var_key in temp_vars:
|
||||
if (isinstance(var_value, list) and temp_vars[var_key] not in var_value) or \
|
||||
(not isinstance(var_value, list) and str(temp_vars[var_key]) != str(var_value)):
|
||||
if isinstance(var_value, list):
|
||||
logger.debug(f'Condition {i} Failed: {var_key} "{temp_vars[var_key]}" not in {var_value}')
|
||||
else:
|
||||
logger.debug(f'Condition {i} Failed: {var_key} "{temp_vars[var_key]}" is not "{var_value}"')
|
||||
condition_passed = False
|
||||
else:
|
||||
logger.debug(f"Condition {i} Failed: {var_key} is not a variable provided or a default variable")
|
||||
condition_passed = False
|
||||
if condition_passed is False:
|
||||
break
|
||||
if condition_passed:
|
||||
condition_found = True
|
||||
defaults[con_key] = condition["value"]
|
||||
break
|
||||
if not condition_found:
|
||||
defaults[con_key] = con_value["default"]
|
||||
else:
|
||||
defaults[k] = v
|
||||
if queue_position and isinstance(queue_position, list):
|
||||
|
|
Loading…
Reference in a new issue