diff --git a/data/interfaces/default/notifier_config.html b/data/interfaces/default/notifier_config.html index 31e051ab..60f2f3f9 100644 --- a/data/interfaces/default/notifier_config.html +++ b/data/interfaces/default/notifier_config.html @@ -14,7 +14,7 @@
@@ -26,7 +26,7 @@
- % for item in notifier['config']: + % for item in notifier['config_options']: % if item['input_type'] == 'help':
@@ -92,12 +92,12 @@
-

Optional: enter a friendly identifier the notification agent (e.g. Recently Added)

+

Optional: Enter a friendly identifier for the notification agent (e.g. Recently Added)

-
+

@@ -178,7 +178,7 @@

@@ -323,7 +323,7 @@ } } - $("${', '.join(['#' + c['name'] for c in notifier['config'] if c.get('refresh')])}").on('change', function () { + $("${', '.join(['#' + c['name'] for c in notifier['config_options'] if c.get('refresh')])}").on('change', function () { // Reload modal to update certain fields doAjaxCall('set_notifier_config', $(this), 'tabs', true, false, reloadModal); return false; diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 1dd10099..593c411b 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -381,7 +381,8 @@ def get_notifier_config(notifier_id=None): notifier_text[k] = {'subject': result.pop(k + '_subject'), 'body': result.pop(k + '_body')} - result['config'] = notifier_config + result['config'] = config + result['config_options'] = notifier_config result['actions'] = notifier_actions result['notify_text'] = notifier_text @@ -478,7 +479,8 @@ def set_notifier_config(notifier_id=None, agent_id=None, **kwargs): def send_notification(notifier_id=None, subject='', body='', notify_action='', **kwargs): notifier_config = get_notifier_config(notifier_id=notifier_id) if notifier_config: - agent = get_agent_class(notifier_config['agent_id']) + agent = get_agent_class(agent_id=notifier_config['agent_id'], + config=notifier_config['config']) return agent.notify(subject=subject, body=body, action=notify_action, diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 4b86b4a4..b4f5fb49 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -2897,6 +2897,11 @@ class WebInterface(object): "incl_subject": 1, "disable_web_preview": 0 }, + "config_options": [{...}, ...] + "actions": {"on_play": 0, + "on_stop": 0, + ... + }, "notify_text": {"on_play": {"subject": "...", "body": "..." } @@ -2904,12 +2909,7 @@ class WebInterface(object): "body": "..." } ... - }, - - "actions": {"on_play": 0, - "on_stop": 0, - ... - } + } } ``` """