From 4eb47f6960e5b3d8dd55b66196b59eeabcf62339 Mon Sep 17 00:00:00 2001 From: McCloudS <64094529+McCloudS@users.noreply.github.com> Date: Tue, 1 Oct 2024 00:07:04 -0600 Subject: [PATCH] Fixed logic flaw in plex processing --- subgen.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subgen.py b/subgen.py index 0f660d8..118d7db 100644 --- a/subgen.py +++ b/subgen.py @@ -246,7 +246,7 @@ def receive_plex_webhook( event = plex_json["event"] logging.debug(f"Plex event detected is: {event}") - if (event in ["library.new", "media.play"] and (procaddedmedia or procmediaonplay)): + if (event == "library.new" and procaddedmedia) or (event == "media.play" and procmediaonplay): fullpath = get_plex_file_name(plex_json['Metadata']['ratingKey'], plexserver, plextoken) logging.debug("Path of file: " + fullpath) @@ -270,8 +270,7 @@ def receive_jellyfin_webhook( logging.debug(f"Jellyfin event detected is: {NotificationType}") logging.debug(f"itemid is: {ItemId}") - if (NotificationType == "ItemAdded" and procaddedmedia) or ( - NotificationType == "PlaybackStart" and procmediaonplay): + if (NotificationType == "ItemAdded" and procaddedmedia) or (NotificationType == "PlaybackStart" and procmediaonplay): fullpath = get_jellyfin_file_name(ItemId, jellyfinserver, jellyfintoken) logging.debug(f"Path of file: {fullpath}")