Apply media type toggles to recently added

This commit is contained in:
Jonathan Wong 2015-11-21 10:28:26 -08:00
parent e6aef01508
commit 17bb57d5f5

View file

@ -169,6 +169,12 @@ def notify(stream_data=None, notify_action=None):
def notify_timeline(timeline_data=None, notify_action=None): def notify_timeline(timeline_data=None, notify_action=None):
if timeline_data and notify_action: 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(): for agent in notifiers.available_notification_agents():
if agent['on_created'] and notify_action == 'created': if agent['on_created'] and notify_action == 'created':
# Build and send notification # Build and send notification
@ -178,6 +184,7 @@ def notify_timeline(timeline_data=None, notify_action=None):
body=notify_strings[1]) body=notify_strings[1])
# Set the notification state in the db # Set the notification state in the db
set_notify_state(session=timeline_data, state=notify_action, agent_info=agent) set_notify_state(session=timeline_data, state=notify_action, agent_info=agent)
elif not timeline_data and notify_action: elif not timeline_data and notify_action:
for agent in notifiers.available_notification_agents(): for agent in notifiers.available_notification_agents():
if agent['on_extdown'] and notify_action == 'extdown': if agent['on_extdown'] and notify_action == 'extdown':