This commit is contained in:
Yozora XCII 2024-05-01 20:34:37 +01:00
parent 860e194069
commit ef3073b2e0
8 changed files with 22 additions and 22 deletions

View file

@ -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

View file

@ -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:

View file

@ -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.<a class="headerlink" href="#overlay-filetype" title="Permanent link"></a>"
??? blank "`overlay_artwork_filetype` - Used to control the filetype used with overlay images.<a class="headerlink" href="#overlay-filetype" title="Permanent link"></a>"
<div id="overlay-filetype" />Used to control the filetype used with overlay images.
<hr style="margin: 0px;">
**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.<a class="headerlink" href="#overlay-quality" title="Permanent link"></a>"
??? blank "`overlay_artwork_quality` - Used to control the JPG or WEBP quality used with overlay images.<a class="headerlink" href="#overlay-quality" title="Permanent link"></a>"
<div id="overlay-quality" />Used to control the JPG or WEBP quality used with overlay images.
<hr style="margin: 0px;">
**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

View file

@ -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,

View file

@ -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:

View file

@ -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"]:

View file

@ -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"]

View file

@ -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)