|
|
@ -403,14 +403,16 @@ 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):
|
|
|
|
|
|
|
|
image = None
|
|
|
|
|
|
|
|
image_compare = None
|
|
|
|
poster_uploaded = False
|
|
|
|
poster_uploaded = False
|
|
|
|
|
|
|
|
if self.config.Cache:
|
|
|
|
|
|
|
|
image, image_compare, _ = self.config.Cache.query_image_map(item.ratingKey, self.image_table_name)
|
|
|
|
|
|
|
|
|
|
|
|
if poster is not None:
|
|
|
|
if poster is not None:
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
image = None
|
|
|
|
if image_compare and str(poster.compare) != str(image_compare):
|
|
|
|
if self.config.Cache:
|
|
|
|
image = None
|
|
|
|
image, image_compare, _ = self.config.Cache.query_image_map(item.ratingKey, self.image_table_name)
|
|
|
|
|
|
|
|
if str(poster.compare) != str(image_compare):
|
|
|
|
|
|
|
|
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)
|
|
|
|
poster_uploaded = True
|
|
|
|
poster_uploaded = True
|
|
|
@ -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}")
|
|
|
|