From ac520d656b0852402cb6eb8dd50497b423872e6a Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Fri, 19 Aug 2022 10:41:02 -0700 Subject: [PATCH] Add "does not begin with" and "does not end with" condition operators --- plexpy/notification_handler.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 497973be..ed4e60b3 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -339,9 +339,15 @@ def notify_custom_conditions(notifier_id=None, parameters=None): elif operator == 'begins with': evaluated = parameter_value.startswith(tuple(values)) + elif operator == 'does not begin with': + evaluated = not parameter_value.startswith(tuple(values)) + elif operator == 'ends with': evaluated = parameter_value.endswith(tuple(values)) + elif operator == 'does not end with': + evaluated = not parameter_value.endswith(tuple(values)) + elif operator == 'is greater than': evaluated = any(parameter_value > c for c in values)