From bc52ac3559e82a239cca2254ca91861cc4d06497 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Wed, 27 Jan 2016 19:51:36 -0800 Subject: [PATCH] Remove media type toggles from recently added notifications --- plexpy/notification_handler.py | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 27ce5a28..d1ea6856 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -211,23 +211,17 @@ def notify(stream_data=None, notify_action=None): def notify_timeline(timeline_data=None, notify_action=None): if timeline_data and notify_action: - if (timeline_data['media_type'] == 'movie' and plexpy.CONFIG.MOVIE_NOTIFY_ENABLE) \ - or ((timeline_data['media_type'] == 'show' or timeline_data['media_type'] == 'episode') \ - and plexpy.CONFIG.TV_NOTIFY_ENABLE) \ - or ((timeline_data['media_type'] == 'artist' or timeline_data['media_type'] == 'track') \ - and plexpy.CONFIG.MUSIC_NOTIFY_ENABLE): - - for agent in notifiers.available_notification_agents(): - if agent['on_created'] and notify_action == 'created': - # Build and send notification - notify_strings = build_notify_text(timeline=timeline_data, state=notify_action) - notifiers.send_notification(config_id=agent['id'], - subject=notify_strings[0], - body=notify_strings[1], - notify_action=notify_action, - script_args=notify_strings[2]) - # Set the notification state in the db - set_notify_state(session=timeline_data, state=notify_action, agent_info=agent) + for agent in notifiers.available_notification_agents(): + if agent['on_created'] and notify_action == 'created': + # Build and send notification + notify_strings = build_notify_text(timeline=timeline_data, state=notify_action) + notifiers.send_notification(config_id=agent['id'], + subject=notify_strings[0], + body=notify_strings[1], + notify_action=notify_action, + script_args=notify_strings[2]) + # Set the notification state in the db + set_notify_state(session=timeline_data, state=notify_action, agent_info=agent) elif not timeline_data and notify_action: for agent in notifiers.available_notification_agents():