Fixed logic flaw in plex processing

This commit is contained in:
McCloudS
2024-10-01 00:07:04 -06:00
committed by GitHub
parent 73a1a8e05c
commit 4eb47f6960

View File

@@ -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}")