diff --git a/VERSION b/VERSION index 927df165..9bb3a155 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.3-develop174 +1.17.3-develop175 diff --git a/defaults/overlays/languages.yml b/defaults/overlays/languages.yml index 83d933d6..96c79db2 100644 --- a/defaults/overlays/languages.yml +++ b/defaults/overlays/languages.yml @@ -45,25 +45,389 @@ external_templates: font: fonts/Inter-Bold.ttf font_size: 50 final_name: text(<>) + +vars: + c: &c 0 + v1: &v1 15 + v2: &v2 76 + v3: &v3 137 + v4: &v4 198 + v5: &v5 259 + vc1: &vc1 -122 + vc2: &vc2 -61 + vc3: &vc3 0 + vc4: &vc4 61 + vc5: &vc5 122 + vhc1: &vhc1 -95 + vhc2: &vhc2 95 + h1: &h1 15 + h2: &h2 206 + h3: &h3 397 + h4: &h4 588 + h5: &h5 779 + hc1: &hc1 0 + hc2: &hc2 191 + hc3: &hc3 -191 + hc4: &hc4 382 + hc5: &hc5 -382 + hvc1: &hvc1 -30 + hvc2: &hvc2 30 queues: flags: default: - vertical_align: top - horizontal_offset: 15 - vertical_offset: 15 - left: - - horizontal_align: left - - vertical_offset: 76 - - vertical_offset: 137 - - vertical_offset: 198 - - vertical_offset: 259 - right: - - horizontal_align: right - - vertical_offset: 76 - - vertical_offset: 137 - - vertical_offset: 198 - - vertical_offset: 259 + position: <>_<>_<>_<> + horizontal_position: left + vertical_position: top + flag_alignment: vertical + flag_position: 1 + horizontal_offset: *h1 + vertical_offset: *v1 + + vertical_top_left_1: + - vertical_align: top + horizontal_align: left + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_top_left_2: + - vertical_align: top + horizontal_align: left + horizontal_offset: *h2 + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_center_left_1: + - vertical_align: center + horizontal_align: left + vertical_offset: *vc1 + - vertical_offset: *vc2 + - vertical_offset: *vc3 + - vertical_offset: *vc4 + - vertical_offset: *vc5 + vertical_center_left_2: + - vertical_align: center + horizontal_align: left + vertical_offset: *vc1 + horizontal_offset: *h2 + - vertical_offset: *vc2 + - vertical_offset: *vc3 + - vertical_offset: *vc4 + - vertical_offset: *vc5 + vertical_bottom_left_1: + - vertical_align: bottom + horizontal_align: left + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_bottom_left_2: + - vertical_align: bottom + horizontal_align: left + horizontal_offset: *h2 + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + + vertical_top_center_0: + - vertical_align: top + horizontal_align: center + horizontal_offset: *c + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_top_center_1: + - vertical_align: top + horizontal_align: center + horizontal_offset: *vhc1 + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_top_center_2: + - vertical_align: top + horizontal_align: center + horizontal_offset: *vhc2 + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_center_center_0: + - vertical_align: center + horizontal_align: center + vertical_offset: *vc1 + horizontal_offset: *c + - vertical_offset: *vc2 + - vertical_offset: *vc3 + - vertical_offset: *vc4 + - vertical_offset: *vc5 + vertical_center_center_1: + - vertical_align: center + horizontal_align: center + vertical_offset: *vc1 + horizontal_offset: *vhc1 + - vertical_offset: *vc2 + - vertical_offset: *vc3 + - vertical_offset: *vc4 + - vertical_offset: *vc5 + vertical_center_center_2: + - vertical_align: center + horizontal_align: center + vertical_offset: *vc1 + horizontal_offset: *vhc2 + - vertical_offset: *vc2 + - vertical_offset: *vc3 + - vertical_offset: *vc4 + - vertical_offset: *vc5 + vertical_bottom_center_0: + - vertical_align: bottom + horizontal_align: center + horizontal_offset: *c + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_bottom_center_1: + - vertical_align: bottom + horizontal_align: center + horizontal_offset: *vhc1 + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_bottom_center_2: + - vertical_align: bottom + horizontal_align: center + horizontal_offset: *vhc2 + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + + vertical_top_right_1: + - vertical_align: top + horizontal_align: right + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_top_right_2: + - vertical_align: top + horizontal_align: right + horizontal_offset: *h2 + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_center_right_1: + - vertical_align: center + horizontal_align: right + vertical_offset: *vc1 + - vertical_offset: *vc2 + - vertical_offset: *vc3 + - vertical_offset: *vc4 + - vertical_offset: *vc5 + vertical_center_right_2: + - vertical_align: center + horizontal_align: right + vertical_offset: *vc1 + horizontal_offset: *h2 + - vertical_offset: *vc2 + - vertical_offset: *vc3 + - vertical_offset: *vc4 + - vertical_offset: *vc5 + vertical_bottom_right_1: + - vertical_align: bottom + horizontal_align: right + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + vertical_bottom_right_2: + - vertical_align: bottom + horizontal_align: right + horizontal_offset: *h2 + - vertical_offset: *v2 + - vertical_offset: *v3 + - vertical_offset: *v4 + - vertical_offset: *v5 + + + horizontal_top_left_1: + - vertical_align: top + horizontal_align: left + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_top_left_2: + - vertical_align: top + horizontal_align: left + vertical_offset: *v2 + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_center_left_0: + - vertical_align: center + horizontal_align: left + vertical_offset: *c + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_center_left_1: + - vertical_align: center + horizontal_align: left + vertical_offset: *hvc1 + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_center_left_2: + - vertical_align: center + horizontal_align: left + vertical_offset: *hvc2 + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_bottom_left_1: + - vertical_align: bottom + horizontal_align: left + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_bottom_left_2: + - vertical_align: bottom + horizontal_align: left + vertical_offset: *v2 + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + + horizontal_top_center_1: + - vertical_align: top + horizontal_align: center + horizontal_offset: *hc1 + - horizontal_offset: *hc2 + - horizontal_offset: *hc3 + - horizontal_offset: *hc4 + - horizontal_offset: *hc5 + horizontal_top_center_2: + - vertical_align: top + horizontal_align: center + vertical_offset: *v2 + horizontal_offset: *hc1 + - horizontal_offset: *hc2 + - horizontal_offset: *hc3 + - horizontal_offset: *hc4 + - horizontal_offset: *hc5 + horizontal_center_center_0: + - vertical_align: center + horizontal_align: center + vertical_offset: *c + horizontal_offset: *hc1 + - horizontal_offset: *hc2 + - horizontal_offset: *hc3 + - horizontal_offset: *hc4 + - horizontal_offset: *hc5 + horizontal_center_center_1: + - vertical_align: center + horizontal_align: center + vertical_offset: *hvc1 + horizontal_offset: *hc1 + - horizontal_offset: *hc2 + - horizontal_offset: *hc3 + - horizontal_offset: *hc4 + - horizontal_offset: *hc5 + horizontal_center_center_2: + - vertical_align: center + horizontal_align: center + vertical_offset: *hvc2 + horizontal_offset: *hc1 + - horizontal_offset: *hc2 + - horizontal_offset: *hc3 + - horizontal_offset: *hc4 + - horizontal_offset: *hc5 + horizontal_bottom_center_1: + - vertical_align: bottom + horizontal_align: center + horizontal_offset: *hc1 + - horizontal_offset: *hc2 + - horizontal_offset: *hc3 + - horizontal_offset: *hc4 + - horizontal_offset: *hc5 + horizontal_bottom_center_2: + - vertical_align: bottom + horizontal_align: center + vertical_offset: *v2 + horizontal_offset: *hc1 + - horizontal_offset: *hc2 + - horizontal_offset: *hc3 + - horizontal_offset: *hc4 + - horizontal_offset: *hc5 + + horizontal_top_right_1: + - vertical_align: top + horizontal_align: right + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_top_right_2: + - vertical_align: top + horizontal_align: right + vertical_offset: *v2 + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_center_right_0: + - vertical_align: center + horizontal_align: right + vertical_offset: *c + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_center_right_1: + - vertical_align: center + horizontal_align: right + vertical_offset: *hvc1 + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_center_right_2: + - vertical_align: center + horizontal_align: right + vertical_offset: *hvc2 + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_bottom_right_1: + - vertical_align: bottom + horizontal_align: right + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 + horizontal_bottom_right_2: + - vertical_align: bottom + horizontal_align: right + vertical_offset: *v2 + - horizontal_offset: *h2 + - horizontal_offset: *h3 + - horizontal_offset: *h4 + - horizontal_offset: *h5 templates: flags: diff --git a/docs/defaults/overlays/languages.md b/docs/defaults/overlays/languages.md index 1aced48c..f0c38f7c 100644 --- a/docs/defaults/overlays/languages.md +++ b/docs/defaults/overlays/languages.md @@ -114,25 +114,29 @@ 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` | `left`/`right` | -| `vertical_offset` | `15`/`76`/`137`/`198`/`259` | -| `vertical_align` | `top` | -| `back_color` | `#00000099` | -| `back_radius` | `26`/` ` | -| `back_width` | `190` | -| `back_height` | `105` | -| `back_align` | `left`/`right` | -| `font` | `fonts/Inter-Bold.ttf` | -| `font_size` | `50` | +| Variable | Default | +|:--------------------|:----------------------------:| +| `horizontal_offset` | `15`/`206`/`397`/`588`/`779` | +| `horizontal_align` | `left`/`right`/`center` | +| `vertical_offset` | `15`/`76`/`137`/`198`/`259` | +| `vertical_align` | `top`/`bottom`/`center` | +| `back_color` | `#00000099` | +| `back_radius` | `26`/` ` | +| `back_width` | `190` | +| `back_height` | `105` | +| `back_align` | `left`/`right` | +| `font` | `fonts/Inter-Bold.ttf` | +| `font_size` | `50` | | Variable | Description & Values | |:------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `position` | **Description:** Changes the position of all Overlay Queues in this File.
**Default:** `left`
**Values:** `left`, `right`, `half`, or List of Coordinates | | `position_audio_flags` | **Description:** Changes the position of the audio flags Overlays.
**Default:** `left`
**Values:** `left`, `right`, `half`, or List of Coordinates | | `position_subtitle_flags` | **Description:** Changes the position of the subtitle flags Overlays.
**Default:** `left`
**Values:** `left`, `right`, `half`, or List of Coordinates | +| `horizontal_position` | **Description:** Choose the horizontal position for the flag group.
**Default:** `left`
**Values:** `left`, `right`, or `center` | +| `vertical_position` | **Description:** Choose the vertical position for the flag group.
**Default:** `top`
**Values:** `top`, `bottom`, or `center` | +| `flag_alignment` | **Description:** Choose the display alignment for the flag group.
**Default:** `vertical`
**Values:** `horizontal`, or `vertical` | +| `flag_position` | **Description:** Choose the display position for the flag group.
**Default:** `1`
**Values:** `0`, `1`, or `2` | | `style` | **Description:** Controls the visual theme of the overlays created.
Values:
roundRound Theme
squareSquare Theme
halfSquare Flag with Round Background
| | `offset` | **Description:** Controls the offset between the flag and the text.
**Default:** `10`
**Values:** Any Integer 0 or greater | | `align` | **Description:** Controls the flag alignment in the backdrop.
**Default:** `left`
**Values:** `left` or `right` | diff --git a/docs/defaults/overlays/ratings.md b/docs/defaults/overlays/ratings.md index af7243a9..25bc2275 100644 --- a/docs/defaults/overlays/ratings.md +++ b/docs/defaults/overlays/ratings.md @@ -86,9 +86,9 @@ All [Shared Overlay Variables](variables) can be appended by `rating1_`, `rating | `rating2_image` | **Description:** Choose the rating image to display in rating2.
**Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, or `mal` | | `rating3` | **Description:** Choose the rating to display in rating3.
**Values:** `critic`, `audience`, or `user` | | `rating3_image` | **Description:** Choose the rating image to display in rating3.
**Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, or `mal` | -| `horizontal_position` | **Description:** Choose the horizontal position for the rating group.
**Values:** `left`, `right`, or `center` | -| `vertical_position` | **Description:** Choose the vertical position for the rating group.
**Values:** `top`, `bottom`, or `center` | -| `rating_alignment` | **Description:** Choose the display alignment for the rating group.
**Values:** `horizontal`, or `vertical` | +| `horizontal_position` | **Description:** Choose the horizontal position for the rating group.
**Default:** `left`
**Values:** `left`, `right`, or `center` | +| `vertical_position` | **Description:** Choose the vertical position for the rating group.
**Default:** `center`
**Values:** `top`, `bottom`, or `center` | +| `rating_alignment` | **Description:** Choose the display alignment for the rating group.
**Default:** `vertical`
**Values:** `horizontal`, or `vertical` | | `font`1 | **Description:** Choose the font for the Overlay.
**Default:** `fonts/Inter-Bold.ttf`
**Values:** Path to font file | | `font_style`1 | **Description:** Font style for Variable Fonts.
**Values:** Variable Font Style | | `font_size`1 | **Description:** Choose the font size for the Overlay.
**Default:** `63`
**Values:** Any Number greater then 0 | diff --git a/modules/meta.py b/modules/meta.py index 9dbada62..1e4d360b 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -1513,36 +1513,43 @@ class OverlayFile(DataFile): for queue_name, queue in queues.items(): queue_position = temp_vars[f"position_{queue_name}"] if f"position_{queue_name}" in temp_vars and temp_vars[f"position_{queue_name}"] else position initial_queue = None + defaults = {"horizontal_align": None, "vertical_align": None, "horizontal_offset": None, "vertical_offset": None} + if isinstance(queue, dict) and "default" in queue and queue["default"] and isinstance(queue["default"], dict): + for k, v in queue["default"].items(): + if k == "position": + if not queue_position: + queue_position = v + else: + defaults[k] = v if queue_position and isinstance(queue_position, list): initial_queue = queue_position - elif queue_position and isinstance(queue, dict) and queue_position in queue: - initial_queue = queue[queue_position] elif isinstance(queue, list): initial_queue = queue elif isinstance(queue, dict): - initial_queue = next((v for k, v in queue.items() if k != "default"), None) + if queue_position: + pos_str = str(queue_position) + for x in range(4): + dict_to_use = temp_vars if x < 2 else defaults + for k, v in dict_to_use.items(): + if f"<<{k}>>" in pos_str: + pos_str = pos_str.replace(f"<<{k}>>", str(v)) + if pos_str in queue: + initial_queue = queue[pos_str] + if not initial_queue: + initial_queue = next((v for k, v in queue.items() if k != "default"), None) if not isinstance(initial_queue, list): raise Failed(f"Config Error: queue {queue_name} must be a list") - - def attr_scanner(attr): - if isinstance(queue, dict) and "default" in queue and attr in queue["default"] and queue["default"][attr] is not None: - return queue["default"][attr] - - horizontal_align = attr_scanner("horizontal_align") - vertical_align = attr_scanner("vertical_align") - horizontal_offset = attr_scanner("horizontal_offset") - vertical_offset = attr_scanner("vertical_offset") final_queue = [] for pos in initial_queue: if not pos: pos = {} - horizontal_align = pos["horizontal_align"] if "horizontal_align" in pos else horizontal_align - vertical_align = pos["vertical_align"] if "vertical_align" in pos else vertical_align - horizontal_offset = pos["horizontal_offset"] if "horizontal_offset" in pos else horizontal_offset - vertical_offset = pos["vertical_offset"] if "vertical_offset" in pos else vertical_offset + defaults["horizontal_align"] = pos["horizontal_align"] if "horizontal_align" in pos else defaults["horizontal_align"] + defaults["vertical_align"] = pos["vertical_align"] if "vertical_align" in pos else defaults["vertical_align"] + defaults["horizontal_offset"] = pos["horizontal_offset"] if "horizontal_offset" in pos else defaults["horizontal_offset"] + defaults["vertical_offset"] = pos["vertical_offset"] if "vertical_offset" in pos else defaults["vertical_offset"] new_pos = { - "horizontal_align": horizontal_align, "vertical_align": vertical_align, - "horizontal_offset": horizontal_offset, "vertical_offset": vertical_offset + "horizontal_align": defaults["horizontal_align"], "vertical_align": defaults["vertical_align"], + "horizontal_offset": defaults["horizontal_offset"], "vertical_offset": defaults["vertical_offset"] } for pk, pv in new_pos.items(): if pv is None: