From ef3073b2e07620a3310f8f6c97d723110ecb73d9 Mon Sep 17 00:00:00 2001 From: Yozora XCII Date: Wed, 1 May 2024 20:34:37 +0100 Subject: [PATCH] 2.0.1 --- CHANGELOG | 2 +- config/config.yml.template | 4 ++-- docs/config/settings.md | 12 ++++++------ json-schema/config-schema.json | 4 ++-- json-schema/prototype_config.yml | 4 ++-- modules/config.py | 8 ++++---- modules/library.py | 4 ++-- modules/overlays.py | 6 +++--- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index d2b6a5df..7275db68 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,7 +3,7 @@ # Removed Features # New Features -Added `overlay_filetype` and `overlay_quality` settings to control the filetype and quality of overlay images. Users can select from JPG, PNG and WEBP. +Added `overlay_artwork_filetype` and `overlay_artwork_quality` settings to control the filetype and quality of overlay images. Users can select from JPG, PNG and WEBP. # Updates diff --git a/config/config.yml.template b/config/config.yml.template index a468313b..28bcec16 100644 --- a/config/config.yml.template +++ b/config/config.yml.template @@ -74,8 +74,8 @@ settings: playlist_report: false verify_ssl: true custom_repo: - overlay_filetype: jpg - overlay_quality: 75 + overlay_artwork_filetype: jpg + overlay_artwork_quality: 75 webhooks: # Can be individually specified per library as well error: version: diff --git a/docs/config/settings.md b/docs/config/settings.md index 2186f245..9d4e48f7 100644 --- a/docs/config/settings.md +++ b/docs/config/settings.md @@ -987,13 +987,13 @@ The available setting attributes which can be set at each level are outlined bel custom_repo: https://github.com/Kometa-Team/Community-Configs/tree/master/meisnate12 ``` -??? blank "`overlay_filetype` - Used to control the filetype used with overlay images." +??? blank "`overlay_artwork_filetype` - Used to control the filetype used with overlay images."
Used to control the filetype used with overlay images.
- **Attribute:** `overlay_filetype` + **Attribute:** `overlay_artwork_filetype` **Levels with this Attribute:** Global/Library @@ -1012,16 +1012,16 @@ The available setting attributes which can be set at each level are outlined bel ```yaml ```yaml settings: - overlay_filetype: png + overlay_artwork_filetype: png ``` -??? blank "`overlay_quality` - Used to control the JPG or WEBP quality used with overlay images." +??? blank "`overlay_artwork_quality` - Used to control the JPG or WEBP quality used with overlay images."
Used to control the JPG or WEBP quality used with overlay images.
- **Attribute:** `overlay_quality` + **Attribute:** `overlay_artwork_quality` **Levels with this Attribute:** Global/Library @@ -1033,7 +1033,7 @@ The available setting attributes which can be set at each level are outlined bel ```yaml settings: - overlay_quality: 95 + overlay_artwork_quality: 95 ``` ## Default Values diff --git a/json-schema/config-schema.json b/json-schema/config-schema.json index 7a903e22..1a943d39 100644 --- a/json-schema/config-schema.json +++ b/json-schema/config-schema.json @@ -896,11 +896,11 @@ } ] }, - "overlay_filetype": { + "overlay_artwork_filetype": { "description": "Used to control the filetype used with overlay images.", "enum": ["jpg", "png", "webp"] }, - "overlay_quality": { + "overlay_artwork_quality": { "description": "Used to control the JPG or WEBP quality used with overlay images.", "type": "integer", "minimum": 1, diff --git a/json-schema/prototype_config.yml b/json-schema/prototype_config.yml index 49d706ce..3e221051 100644 --- a/json-schema/prototype_config.yml +++ b/json-schema/prototype_config.yml @@ -440,8 +440,8 @@ settings: playlist_report: false verify_ssl: true custom_repo: - overlay_filetype: jpg - overlay_quality: jpg + overlay_artwork_filetype: jpg + overlay_artwork_quality: jpg webhooks: # Can be individually specified per library as well error: version: diff --git a/modules/config.py b/modules/config.py index db716f7a..b0b3ff25 100644 --- a/modules/config.py +++ b/modules/config.py @@ -478,8 +478,8 @@ class ConfigFile: "playlist_report": check_for_attribute(self.data, "playlist_report", parent="settings", var_type="bool", default=True), "verify_ssl": check_for_attribute(self.data, "verify_ssl", parent="settings", var_type="bool", default=True), "custom_repo": check_for_attribute(self.data, "custom_repo", parent="settings", default_is_none=True), - "overlay_filetype": check_for_attribute(self.data, "overlay_filetype", parent="settings", test_list=filetype_list, default="jpg"), - "overlay_quality": check_for_attribute(self.data, "overlay_quality", parent="settings", var_type="int", default_is_none=True, int_min=1, int_max=100), + "overlay_artwork_filetype": check_for_attribute(self.data, "overlay_artwork_filetype", parent="settings", test_list=filetype_list, default="jpg"), + "overlay_artwork_quality": check_for_attribute(self.data, "overlay_artwork_quality", parent="settings", var_type="int", default_is_none=True, int_min=1, int_max=100), "assets_for_all": check_for_attribute(self.data, "assets_for_all", parent="settings", var_type="bool", default=False, save=False, do_print=False) } self.custom_repo = None @@ -858,8 +858,8 @@ class ConfigFile: params["ignore_ids"].extend([i for i in self.general["ignore_ids"] if i not in params["ignore_ids"]]) params["ignore_imdb_ids"] = check_for_attribute(lib, "ignore_imdb_ids", parent="settings", var_type="lower_list", default_is_none=True, do_print=False, save=False) params["ignore_imdb_ids"].extend([i for i in self.general["ignore_imdb_ids"] if i not in params["ignore_imdb_ids"]]) - params["overlay_filetype"] = check_for_attribute(lib, "overlay_filetype", parent="settings", test_list=filetype_list, default=self.general["overlay_filetype"], do_print=False, save=False) - params["overlay_quality"] = check_for_attribute(lib, "overlay_quality", parent="settings", var_type="int", default=self.general["overlay_quality"], default_is_none=True, int_min=1, int_max=100, do_print=False, save=False) + params["overlay_artwork_filetype"] = check_for_attribute(lib, "overlay_artwork_filetype", parent="settings", test_list=filetype_list, default=self.general["overlay_artwork_filetype"], do_print=False, save=False) + params["overlay_artwork_quality"] = check_for_attribute(lib, "overlay_artwork_quality", parent="settings", var_type="int", default=self.general["overlay_artwork_quality"], default_is_none=True, int_min=1, int_max=100, do_print=False, save=False) params["changes_webhooks"] = check_for_attribute(lib, "changes", parent="webhooks", var_type="list", default=self.webhooks["changes"], do_print=False, save=False, default_is_none=True) params["report_path"] = None if lib and "report_path" in lib and lib["report_path"]: diff --git a/modules/library.py b/modules/library.py index 0b4774b5..1030849d 100644 --- a/modules/library.py +++ b/modules/library.py @@ -81,8 +81,8 @@ class Library(ABC): self.only_filter_missing = params["only_filter_missing"] self.ignore_ids = params["ignore_ids"] self.ignore_imdb_ids = params["ignore_imdb_ids"] - self.overlay_quality = params["overlay_quality"] - self.overlay_filetype = params["overlay_filetype"] + self.overlay_artwork_quality = params["overlay_artwork_quality"] + self.overlay_artwork_filetype = params["overlay_artwork_filetype"] self.assets_for_all = params["assets_for_all"] self.assets_for_all_collections = False self.delete_collections = params["delete_collections"] diff --git a/modules/overlays.py b/modules/overlays.py index 2dd39fb8..ba1b3617 100644 --- a/modules/overlays.py +++ b/modules/overlays.py @@ -512,9 +512,9 @@ class Overlays: else: overlay_box = current_overlay.get_coordinates((canvas_width, canvas_height), box=current_overlay.image.size, new_cords=cord) new_poster.paste(current_overlay.image, overlay_box, current_overlay.image) - temp = os.path.join(self.library.overlay_folder, f"temp.{self.library.overlay_filetype}") - if self.library.overlay_quality and self.library.overlay_filetype in ["jpg", "webp"]: - new_poster.save(temp, exif=exif_tags, quality=self.library.overlay_quality) + temp = os.path.join(self.library.overlay_folder, f"temp.{self.library.overlay_artwork_filetype}") + if self.library.overlay_artwork_quality and self.library.overlay_artwork_filetype in ["jpg", "webp"]: + new_poster.save(temp, exif=exif_tags, quality=self.library.overlay_artwork_quality) else: new_poster.save(temp, exif=exif_tags) self.library.upload_poster(item, temp)