From cdf777e57670ad10dbda979d409f09b7d9901b86 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 8 Mar 2023 09:05:33 -0500 Subject: [PATCH] [4] fix plex reset --- VERSION | 2 +- pmm_overlay_reset.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index a7ef7e8..14e328e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.10-develop3 +0.9.10-develop4 diff --git a/pmm_overlay_reset.py b/pmm_overlay_reset.py index 79925eb..d9b6585 100644 --- a/pmm_overlay_reset.py +++ b/pmm_overlay_reset.py @@ -179,18 +179,19 @@ def detect_overlay_in_image(item_title, poster_source, shape, img_path=None, url def reset_from_plex(item_title, item_with_posters, shape, ignore=0): for p, plex_poster in enumerate(item_with_posters.posters(), 1): logger.trace(plex_poster.key) + reset_url = None if plex_poster.key.startswith("/"): temp_url = f"{pmmargs['url']}{plex_poster.key}&X-Plex-Token={pmmargs['token']}" - if plex_poster.ratingKey.startswith("upload"): - if detect_overlay_in_image(item_title, f"Plex Poster {p}", shape, url_path=temp_url) is False: - if ignore < 1: - return temp_url - else: - ignore -= 1 - elif ignore < 1: - return plex_poster.key + user = plex_poster.ratingKey.startswith("upload") + if not user or (user and detect_overlay_in_image(item_title, f"Plex Poster {p}", shape, url_path=temp_url) is False): + reset_url = temp_url else: - ignore -= 1 + reset_url = plex_poster.key + if reset_url: + if ignore < 1: + return reset_url + else: + ignore -= 1 def reset_poster(item_title, plex_item, tmdb_poster_url, asset_directory, asset_file_name, parent=None, shape="portrait"): poster_source = None