fix overlay and icheckmovies issue

pull/351/head
meisnate12 3 years ago
parent ddc456da2c
commit 7f1593ecd8

@ -1561,7 +1561,7 @@ class CollectionBuilder:
if self.config.Cache: if self.config.Cache:
rating_keys = self.config.Cache.query_image_map_overlay(self.library.image_table_name, overlay_name) rating_keys = self.config.Cache.query_image_map_overlay(self.library.image_table_name, overlay_name)
overlay_folder = os.path.join(self.config.default_dir, "overlays", overlay_name) overlay_folder = os.path.join(self.config.default_dir, "overlays", overlay_name)
overlay_image = Image.open(os.path.join(overlay_folder, "overlay.png")) overlay_image = Image.open(os.path.join(overlay_folder, "overlay.png")).convert("RGBA")
temp_image = os.path.join(overlay_folder, f"temp.png") temp_image = os.path.join(overlay_folder, f"temp.png")
overlay = (overlay_name, overlay_folder, overlay_image, temp_image) overlay = (overlay_name, overlay_folder, overlay_image, temp_image)

@ -28,8 +28,9 @@ class ICheckMovies:
list_url = icheckmovies_list.strip() list_url = icheckmovies_list.strip()
if not list_url.startswith(base_url): if not list_url.startswith(base_url):
raise Failed(f"ICheckMovies Error: {list_url} must begin with: {base_url}") raise Failed(f"ICheckMovies Error: {list_url} must begin with: {base_url}")
if len(self._parse_list(list_url, language)) > 0: elif len(self._parse_list(list_url, language)) > 0:
valid_lists.append(list_url) valid_lists.append(list_url)
else:
raise Failed(f"ICheckMovies Error: {list_url} failed to parse") raise Failed(f"ICheckMovies Error: {list_url} failed to parse")
return valid_lists return valid_lists

@ -420,7 +420,7 @@ class Plex:
shutil.copyfile(temp_image, os.path.join(overlay_folder, f"{item.ratingKey}.png")) shutil.copyfile(temp_image, os.path.join(overlay_folder, f"{item.ratingKey}.png"))
while util.is_locked(temp_image): while util.is_locked(temp_image):
time.sleep(1) time.sleep(1)
new_poster = Image.open(temp_image) new_poster = Image.open(temp_image).convert("RGBA")
new_poster = new_poster.resize(overlay_image.size, Image.ANTIALIAS) new_poster = new_poster.resize(overlay_image.size, Image.ANTIALIAS)
new_poster.paste(overlay_image, (0, 0), overlay_image) new_poster.paste(overlay_image, (0, 0), overlay_image)
new_poster.save(temp_image) new_poster.save(temp_image)

Loading…
Cancel
Save