overlay fix

pull/362/head
meisnate12 3 years ago
parent 67e599c20b
commit c8394e4bdb

@ -403,13 +403,15 @@ class Plex:
self.reload(item) self.reload(item)
def upload_images(self, item, poster=None, background=None, overlay=None): def upload_images(self, item, poster=None, background=None, overlay=None):
poster_uploaded = False
if poster is not None:
try:
image = None image = None
image_compare = None
poster_uploaded = False
if self.config.Cache: if self.config.Cache:
image, image_compare, _ = self.config.Cache.query_image_map(item.ratingKey, self.image_table_name) image, image_compare, _ = self.config.Cache.query_image_map(item.ratingKey, self.image_table_name)
if str(poster.compare) != str(image_compare):
if poster is not None:
try:
if image_compare and str(poster.compare) != str(image_compare):
image = None image = None
if image is None or image != item.thumb: if image is None or image != item.thumb:
self._upload_image(item, poster) self._upload_image(item, poster)
@ -427,6 +429,8 @@ class Plex:
image_overlay = None image_overlay = None
if self.config.Cache: if self.config.Cache:
_, _, image_overlay = self.config.Cache.query_image_map(item.ratingKey, self.image_table_name) _, _, image_overlay = self.config.Cache.query_image_map(item.ratingKey, self.image_table_name)
if image is None or image != item.thumb:
image_overlay = None
if poster_uploaded or not image_overlay or image_overlay != overlay_name: if poster_uploaded or not image_overlay or image_overlay != overlay_name:
if not item.posterUrl: if not item.posterUrl:
raise Failed(f"Overlay Error: No existing poster to Overlay for {item.title}") raise Failed(f"Overlay Error: No existing poster to Overlay for {item.title}")

Loading…
Cancel
Save