mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Update activity_pinger for recently added
This commit is contained in:
parent
4c388f60d6
commit
b9f47df930
7 changed files with 111 additions and 26 deletions
|
@ -172,19 +172,10 @@ def notify_timeline(timeline_data=None, notify_action=None):
|
|||
if timeline_data and notify_action:
|
||||
for agent in notifiers.available_notification_agents():
|
||||
if agent['on_created'] and notify_action == 'created':
|
||||
if plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_GRANDPARENT \
|
||||
and (timeline_data['media_type'] == 'movie' or timeline_data['media_type'] == 'show' \
|
||||
or timeline_data['media_type'] == 'artist'):
|
||||
# Build and send notification
|
||||
notify_strings = build_notify_text(session=timeline_data, state=notify_action)
|
||||
notifiers.send_notification(config_id=agent['id'],
|
||||
subject=notify_strings[0],
|
||||
body=notify_strings[1])
|
||||
# Set the notification state in the db
|
||||
set_notify_state(session=timeline_data, state=notify_action, agent_info=agent)
|
||||
elif not plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_GRANDPARENT \
|
||||
and (timeline_data['media_type'] == 'movie' or timeline_data['media_type'] == 'episode' \
|
||||
or timeline_data['media_type'] == 'track'):
|
||||
if (plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_GRANDPARENT \
|
||||
and (timeline_data['media_type'] == 'movie' or timeline_data['media_type'] == 'show' or timeline_data['media_type'] == 'artist')) \
|
||||
or (not plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_GRANDPARENT \
|
||||
and (timeline_data['media_type'] == 'movie' or timeline_data['media_type'] == 'episode' or timeline_data['media_type'] == 'track')):
|
||||
# Build and send notification
|
||||
notify_strings = build_notify_text(session=timeline_data, state=notify_action)
|
||||
notifiers.send_notification(config_id=agent['id'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue