Skip to content

Commit

Permalink
Fixed logic flaw in plex processing
Browse files Browse the repository at this point in the history
  • Loading branch information
McCloudS authored Oct 1, 2024
1 parent 73a1a8e commit 4eb47f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions subgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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

Expand Down

0 comments on commit 4eb47f6

Please sign in to comment.