Fixed logic flaw in plex processing

This commit is contained in:
McCloudS authored and GitHub committed 2024-10-01 00:07:04 -06:00
1 parent 73a1a8e05c
commit 4eb47f6960
1 file changed
+2 -3
+2 -3
View File
@@ -246,7 +246,7 @@ def receive_plex_webhook(
event = plex_json["event"] event = plex_json["event"]
logging.debug(f"Plex event detected is: {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) fullpath = get_plex_file_name(plex_json['Metadata']['ratingKey'], plexserver, plextoken)
logging.debug("Path of file: " + fullpath) 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"Jellyfin event detected is: {NotificationType}")
logging.debug(f"itemid is: {ItemId}") logging.debug(f"itemid is: {ItemId}")
if (NotificationType == "ItemAdded" and procaddedmedia) or ( if (NotificationType == "ItemAdded" and procaddedmedia) or (NotificationType == "PlaybackStart" and procmediaonplay):
NotificationType == "PlaybackStart" and procmediaonplay):
fullpath = get_jellyfin_file_name(ItemId, jellyfinserver, jellyfintoken) fullpath = get_jellyfin_file_name(ItemId, jellyfinserver, jellyfintoken)
logging.debug(f"Path of file: {fullpath}") logging.debug(f"Path of file: {fullpath}")