Skip to content

Commit

Permalink
[4] fix plex reset
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 committed Mar 8, 2023
1 parent 91deb68 commit cdf777e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.10-develop3
0.9.10-develop4
19 changes: 10 additions & 9 deletions pmm_overlay_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cdf777e

Please sign in to comment.