fix overlay and icheckmovies issue

This commit is contained in:
meisnate12 2021-07-26 10:55:28 -04:00
parent ddc456da2c
commit 7f1593ecd8
3 changed files with 5 additions and 4 deletions

View file

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

View file

@ -28,9 +28,10 @@ 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)
raise Failed(f"ICheckMovies Error: {list_url} failed to parse") else:
raise Failed(f"ICheckMovies Error: {list_url} failed to parse")
return valid_lists return valid_lists
def get_items(self, method, data, language): def get_items(self, method, data, language):

View file

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