|
|
@ -120,9 +120,9 @@ class Overlays:
|
|
|
|
if poster is None and has_original is None:
|
|
|
|
if poster is None and has_original is None:
|
|
|
|
logger.error(f"Overlay Error: No poster found for {item.title}")
|
|
|
|
logger.error(f"Overlay Error: No poster found for {item.title}")
|
|
|
|
elif changed_image or overlay_change:
|
|
|
|
elif changed_image or overlay_change:
|
|
|
|
|
|
|
|
try:
|
|
|
|
new_poster = Image.open(poster.location if poster else has_original).convert("RGBA")
|
|
|
|
new_poster = Image.open(poster.location if poster else has_original).convert("RGBA")
|
|
|
|
temp = os.path.join(self.library.overlay_folder, f"temp.png")
|
|
|
|
temp = os.path.join(self.library.overlay_folder, f"temp.png")
|
|
|
|
try:
|
|
|
|
|
|
|
|
blur_num = 0
|
|
|
|
blur_num = 0
|
|
|
|
for over_name in over_names:
|
|
|
|
for over_name in over_names:
|
|
|
|
if over_name.startswith("blur"):
|
|
|
|
if over_name.startswith("blur"):
|
|
|
@ -144,6 +144,8 @@ class Overlays:
|
|
|
|
except (OSError, BadRequest) as e:
|
|
|
|
except (OSError, BadRequest) as e:
|
|
|
|
logger.stacktrace()
|
|
|
|
logger.stacktrace()
|
|
|
|
raise Failed(f"Overlay Error: {e}")
|
|
|
|
raise Failed(f"Overlay Error: {e}")
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
logger.error(f"Overlay Not Needed for {item.title}")
|
|
|
|
|
|
|
|
|
|
|
|
if self.config.Cache and poster_compare:
|
|
|
|
if self.config.Cache and poster_compare:
|
|
|
|
self.config.Cache.update_image_map(item.ratingKey, self.library.image_table_name, item.thumb,
|
|
|
|
self.config.Cache.update_image_map(item.ratingKey, self.library.image_table_name, item.thumb,
|
|
|
@ -214,9 +216,13 @@ class Overlays:
|
|
|
|
_, image_compare, _ = self.config.Cache.query_image_map(overlay_name, f"{self.library.image_table_name}_overlays")
|
|
|
|
_, image_compare, _ = self.config.Cache.query_image_map(overlay_name, f"{self.library.image_table_name}_overlays")
|
|
|
|
overlay_size = os.stat(properties[overlay_name]["path"]).st_size
|
|
|
|
overlay_size = os.stat(properties[overlay_name]["path"]).st_size
|
|
|
|
properties[overlay_name]["updated"] = not image_compare or str(overlay_size) != str(image_compare)
|
|
|
|
properties[overlay_name]["updated"] = not image_compare or str(overlay_size) != str(image_compare)
|
|
|
|
|
|
|
|
try:
|
|
|
|
properties[overlay_name]["image"] = Image.open(properties[overlay_name]["path"]).convert("RGBA")
|
|
|
|
properties[overlay_name]["image"] = Image.open(properties[overlay_name]["path"]).convert("RGBA")
|
|
|
|
if self.config.Cache:
|
|
|
|
if self.config.Cache:
|
|
|
|
self.config.Cache.update_image_map(overlay_name, f"{self.library.image_table_name}_overlays", overlay_name, overlay_size)
|
|
|
|
self.config.Cache.update_image_map(overlay_name, f"{self.library.image_table_name}_overlays", overlay_name, overlay_size)
|
|
|
|
|
|
|
|
except OSError:
|
|
|
|
|
|
|
|
logger.error(f"Overlay Error: overlay image {properties[overlay_name]['path']} failed to load")
|
|
|
|
|
|
|
|
properties.pop(overlay_name)
|
|
|
|
|
|
|
|
|
|
|
|
for overlay_name, over_attrs in properties.items():
|
|
|
|
for overlay_name, over_attrs in properties.items():
|
|
|
|
for over_key in over_attrs["keys"]:
|
|
|
|
for over_key in over_attrs["keys"]:
|
|
|
|