From 7a70ab8f4cfb634bae9ae246e49ee3d1240f29d9 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Fri, 11 Nov 2022 10:57:36 -0500 Subject: [PATCH] [9] update navlinks and fix ratings --- VERSION | 2 +- defaults/overlays/images/rating/Average.png | Bin 2196 -> 0 bytes defaults/overlays/ratings.yml | 6 +-- docs/_templates/navbar.html | 6 +-- docs/conf.py | 6 +-- docs/defaults/overlays/ratings.md | 40 ++++++++++---------- modules/meta.py | 7 +++- 7 files changed, 35 insertions(+), 32 deletions(-) delete mode 100644 defaults/overlays/images/rating/Average.png diff --git a/VERSION b/VERSION index 3fa4cf87..4ba2dcaa 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.18.0-develop8 +1.18.0-develop9 diff --git a/defaults/overlays/images/rating/Average.png b/defaults/overlays/images/rating/Average.png deleted file mode 100644 index a9ac00829269e32a5bcb217dc4f0af0b29789264..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2196 zcmaJ@X;f2Z8onWrkU$hFs5lm{i3>WCo0X72!j`a9K?p$^K{SL5M9e~Rfv}z^3WcFa z9Vu2tP^(B0Xa{~|q7=~<29UJ^ipqLK9B>q&iZI%_v0&$i)9;-7E$?}r_kG^w$IS~4 z@*@$~5di=o1^5fa=oxJKEOF>wX#27nJsc2GI1;LgMN*_181RZwMZ;i#LK+8)VQEZi zVk_(p0N5>ZNjMT7xQi!KDX3BthN@GjQ8oa$d+5|sSptlJ(Quqx$tOR*-be=JF?{k~ zb|5WK?E}Zl{nIpXXj+g&mX;vn#*jS(pu3KTI#9rf6x1mWE44fwpZwl0551er5E*dSGV`*7)Wk0Bn)i_Ro3abrG`_!5`(f4LAU1~PT_e>%NvLdVB+{V=-d zU(R<- ziHq&(G|uLFjB?%Tn2mLH%*Bp7U)i2$Y4VS}uTKBE@bQ^rHNLeYjb-Jvmpmr-bQjE5 zUp5xYH!o~S%Nd`Inp4inN{MGHM~hS32<{_Ylh<2uBO`;^ox5i;1si0*ii@Sx!pic9 z6ByUv*&bzD{pQL0xDn5vx+#(CImCtz04czAKXxpvr2)SVxR-Qr60b5_fVrWJRcB|m zU|*EAS@cfR0B7eH_c9dKUR^8z^BLdeKm>QP8dn}Z+jqqQPb$K7F?tI6CZC4j{2QM8 z=gs|NvLgf+UIU)UziMXpEVFdqU(c@=>7(#n*>Y>+rhK5?ZX(Q7Mp)kM;wqtgU9!m0LJc3jGU;ewc)pW^UD&=45}zBa9HV z_WAoWe=G!&U(8ny&=RYoV*8~lPe&Lcl&r%!5=z~nM1fV~6;#ih1wb0;jb7n`gjQ=YB9t2zqU^Fhv7i7f*?sldz4LL1RHwZkAoN?u21QiHKQ5dgNh|;4-~_o|!vV zG8Q=zU4u2ZD4HW>T3>@>A8phRbin*(IJX?*eQTB#NMglX*B)uVcX7KCusig3AIPzI1Lj&%yK#F-dXxgw?A>kEf>`+PbjkMy zirP+BP(1Uab`de2X-~W_6au%qGZe-D!l_y2262?<=EztDK*f`igVMTp1lReA9Bzs& z%c70IogDq^DnfqSxy#s_$EUx`YrEl(*GEYHa}wjUQ`8=U>F!D~u(BIxq03%aN&i`{ z@JP_Uxu|A=8S!XYK>evHo3)0YYMqp~qWmLQf>5pu!1NVoNZwP#q!7wHE(LLbf*UCI0T zVW|3@d(r3QR^Zg9t)Ug_Q|U7$W={`j1}_nLr^AhyHs9p3Z2JbmO3iF*VrTZtv@Kum zrd#^HMP>_image: [anidb, letterboxd, rt_popcorn, mdblist, tmdb, trakt, mal, average, star] + rating<>_image: [anidb, letterboxd, rt_popcorn, mdblist, tmdb, trakt, mal, star] value: false - image_level: Top overlay_level: episode @@ -97,7 +97,7 @@ templates: conditions: - rating<>_image: [rt_popcorn, rt_tomato, tmdb] value: "%" - - rating<>_image: metacritic + - rating<>_image: [metacritic, mdb] value: "0" image_extra: default: "" @@ -129,8 +129,6 @@ templates: value: Trakt - rating<>_image: mal value: MAL - - rating<>_image: average - value: Average - rating<>_image: star value: Star rating<>_horizontal_align: diff --git a/docs/_templates/navbar.html b/docs/_templates/navbar.html index c398ea7e..2b88cb40 100644 --- a/docs/_templates/navbar.html +++ b/docs/_templates/navbar.html @@ -59,7 +59,7 @@ {% elif specificlink|length > 2 %}
  • {{ specificlink[0] }}
  • {% else %} -
  • {{ specificlink[0] }}
  • +
  • {{ specificlink[0] }}
  • {% endif %} {%- endfor %} @@ -67,7 +67,7 @@ {% elif sublink|length > 2 %}
  • {{ sublink[0] }}
  • {% else %} -
  • {{ sublink[0] }}
  • +
  • {{ sublink[0] }}
  • {% endif %} {%- endfor %} @@ -75,7 +75,7 @@ {% elif link|length > 2 %}
  • {{ link[0] }}
  • {% else %} -
  • {{ link[0] }}
  • +
  • {{ link[0] }}
  • {% endif %} {%- endfor %} diff --git a/docs/conf.py b/docs/conf.py index 34cc5bf9..bbd0ad73 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -144,9 +144,9 @@ html_theme_options = { ("Image Asset Directory Guide", "home/guides/assets"), ("Formula 1 Metadata Guide", "home/guides/formula"), ("_divider", ), - ("User Configs Repository", "https://github.com/meisnate12/Plex-Meta-Manager-Configs", True), - ("Discord Server", "https://discord.gg/NfH6mGFuAB", True), - ("Donate/Sponsor", "https://github.com/sponsors/meisnate12", True), + ("User Configs Repository", "https://github.com/meisnate12/Plex-Meta-Manager-Configs"), + ("Discord Server", "https://discord.gg/NfH6mGFuAB"), + ("Donate/Sponsor", "https://github.com/sponsors/meisnate12"), ("Acknowledgements", "home/acknowledgements"), ]), ("_menu", "Config", [ diff --git a/docs/defaults/overlays/ratings.md b/docs/defaults/overlays/ratings.md index 87064642..e3802467 100644 --- a/docs/defaults/overlays/ratings.md +++ b/docs/defaults/overlays/ratings.md @@ -78,26 +78,26 @@ All [Shared Overlay Variables](../overlay_variables) can be appended by `rating1 | `back_radius` | `30` | | `back_height` | `105` | -| Variable | Description & Values | -|:-----------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `rating1` | **Description:** Choose the rating to display in rating1.
    **Values:** `critic`, `audience`, or `user` | -| `rating1_image` | **Description:** Choose the rating image to display in rating1.
    **Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdblist`, `average`, or `star` | -| `rating2` | **Description:** Choose the rating to display in rating2.
    **Values:** `critic`, `audience`, or `user` | -| `rating2_image` | **Description:** Choose the rating image to display in rating2.
    **Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdblist`, `average`, or `star` | -| `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`, `mal`, `mdblist`, `average`, or `star` | -| `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 | -| `font_color`1 | **Description:** Choose the font color for the Overlay.
    **Default:** `#FFFFFF`
    **Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA` | -| `stroke_width`1 | **Description:** Font Stroke Width for the Text Overlay.
    **Values:** Any Number greater then 0 | -| `stroke_color`1 | **Description:** Font Stroke Color for the Text Overlay.
    **Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA` | -| `addon_offset`1 | **Description:** Text Addon Image Offset from the text.
    **Default:** `15`
    **Values:** Any Number greater then 0 | -| `addon_position`1 | **Description:** Text Addon Image Alignment in relation to the text.
    **Default:** `left`
    **Values:** `left`, `right`, `top`, `bottom` | -| `overlay_level` | **Description:** Choose the Overlay Level.
    **Values:** `episode` | +| Variable | Description & Values | +|:-----------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `rating1` | **Description:** Choose the rating to display in rating1.
    **Values:** `critic`, `audience`, or `user` | +| `rating1_image` | **Description:** Choose the rating image to display in rating1.
    **Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdblist`, or `star` | +| `rating2` | **Description:** Choose the rating to display in rating2.
    **Values:** `critic`, `audience`, or `user` | +| `rating2_image` | **Description:** Choose the rating image to display in rating2.
    **Values:** `anidb`, `imdb`, `letterboxd`, `tmdb`, `metacritic`, `rt_popcorn`, `rt_tomato`, `trakt`, `mal`, `mdblist`, or `star` | +| `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`, `mal`, `mdblist`, or `star` | +| `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 | +| `font_color`1 | **Description:** Choose the font color for the Overlay.
    **Default:** `#FFFFFF`
    **Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA` | +| `stroke_width`1 | **Description:** Font Stroke Width for the Text Overlay.
    **Values:** Any Number greater then 0 | +| `stroke_color`1 | **Description:** Font Stroke Color for the Text Overlay.
    **Values:** Color Hex Code in format `#RGB`, `#RGBA`, `#RRGGBB` or `#RRGGBBAA` | +| `addon_offset`1 | **Description:** Text Addon Image Offset from the text.
    **Default:** `15`
    **Values:** Any Number greater then 0 | +| `addon_position`1 | **Description:** Text Addon Image Alignment in relation to the text.
    **Default:** `left`
    **Values:** `left`, `right`, `top`, `bottom` | +| `overlay_level` | **Description:** Choose the Overlay Level.
    **Values:** `episode` | 1. These Variables can be appended by `rating1_`, `rating2_`, or `rating3_` to change that attribute on each rating individually. diff --git a/modules/meta.py b/modules/meta.py index 37b819bf..1cf7fd41 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -253,6 +253,8 @@ class DataFile: raise Failed(f"{self.data_type} Error: template sub-attribute default is not a dictionary") init_defaults = template["default"] all_init_defaults = {k: v for k, v in init_defaults.items()} + + temp_conditionals = {} for input_dict, input_type, overwrite_call in [ (temp_vars, "External", False), (extra_variables, "Definition", False), @@ -267,7 +269,7 @@ class DataFile: if not isinstance(input_value, dict): raise Failed(f"{self.data_type} Error: {input_type} template sub-attribute conditionals is not a dictionary") for ck, cv in input_value.items(): - conditionals[ck] = cv + temp_conditionals[ck] = cv elif input_key == "default": if not input_value: raise Failed(f"{self.data_type} Error: {input_type} template sub-attribute default is blank") @@ -284,6 +286,9 @@ class DataFile: for k, v in added_vars.items(): if k not in variables: variables[k] = v + for k, v in temp_conditionals.items(): + if k not in variables: + conditionals[k] = v language = variables["language"] if "language" in variables else "default" translation_variables = {k: v[language if language in v else "default"] for k, v in self.translations.items()}