From f77e061ff1eca51c653c351993041cf168bf3f5e Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Sat, 25 Mar 2017 12:17:04 -0700 Subject: [PATCH] Catch notifier config error --- data/interfaces/default/css/plexpy.css | 3 ++- data/interfaces/default/notifier_config.html | 24 ++++++++++++++++---- plexpy/notifiers.py | 10 +++++--- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index d8790d57..17cdfd68 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -372,7 +372,8 @@ fieldset[disabled] .btn-bright.active { .modal-body a:focus i.fa { color: #f9aa03; } -.modal-body strong { +.modal-body strong, +.modal-body strong i.fa { color: #F9AA03; } .modal-footer { diff --git a/data/interfaces/default/notifier_config.html b/data/interfaces/default/notifier_config.html index 2b7eed11..4cb74836 100644 --- a/data/interfaces/default/notifier_config.html +++ b/data/interfaces/default/notifier_config.html @@ -202,7 +202,7 @@

- Test if ${notifier['agent_label']} notifications are working. See the logs for troubleshooting. + Test if ${notifier['agent_label']} notifications are working. Check the logs for troubleshooting.

% if notifier['agent_name'] == 'scripts':
@@ -252,7 +252,6 @@
-% endif +% else: + +% endif diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 7ce623eb..b546e904 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -398,9 +398,13 @@ def get_notifier_config(notifier_id=None): if not result: return None - config = json.loads(result.pop('notifier_config') or '{}') - notifier_agent = get_agent_class(agent_id=result['agent_id'], config=config) - notifier_config = notifier_agent.return_config_options() + try: + config = json.loads(result.pop('notifier_config') or '{}') + notifier_agent = get_agent_class(agent_id=result['agent_id'], config=config) + notifier_config = notifier_agent.return_config_options() + except Exception as e: + logger.error(u"PlexPy Notifiers :: Failed to get notifier config options: %s." % e) + return notify_actions = get_notify_actions()