mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Move webserver notify to API
This commit is contained in:
parent
29ab470e42
commit
9b4536f132
4 changed files with 52 additions and 8 deletions
|
@ -332,7 +332,7 @@ def notify(notifier_id=None, notify_action=None, stream_data=None, timeline_data
|
|||
if not notifier_config:
|
||||
return
|
||||
|
||||
if notify_action == 'test':
|
||||
if notify_action in ('test', 'api'):
|
||||
subject = kwargs.pop('subject', 'Tautulli')
|
||||
body = kwargs.pop('body', 'Test Notification')
|
||||
script_args = kwargs.pop('script_args', [])
|
||||
|
@ -350,8 +350,8 @@ def notify(notifier_id=None, notify_action=None, stream_data=None, timeline_data
|
|||
|
||||
# Set the notification state in the db
|
||||
notification_id = set_notify_state(session=stream_data or timeline_data,
|
||||
notify_action=notify_action,
|
||||
notifier=notifier_config,
|
||||
notify_action=notify_action,
|
||||
subject=subject,
|
||||
body=body,
|
||||
script_args=script_args)
|
||||
|
@ -390,9 +390,9 @@ def get_notify_state(session):
|
|||
return notify_states
|
||||
|
||||
|
||||
def set_notify_state(notify_action, notifier, subject, body, script_args, session=None):
|
||||
def set_notify_state(notifier, notify_action, subject='', body='', script_args='', session=None):
|
||||
|
||||
if notify_action and notifier:
|
||||
if notifier and notify_action:
|
||||
monitor_db = database.MonitorDatabase()
|
||||
|
||||
session = session or {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue