diff --git a/data/interfaces/default/notifiers_table.html b/data/interfaces/default/notifiers_table.html
index b0e7396f..5a86ebf4 100644
--- a/data/interfaces/default/notifiers_table.html
+++ b/data/interfaces/default/notifiers_table.html
@@ -13,7 +13,7 @@ DOCUMENTATION :: END
% for notifier in notifiers_list:
-
+
${notifier['agent_label']} (${notifier['friendly_name'] or notifier['id']})
diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py
index 16ef2604..508b0952 100644
--- a/plexpy/notifiers.py
+++ b/plexpy/notifiers.py
@@ -323,17 +323,21 @@ def get_notify_actions():
def get_notifiers(notifier_id=None, notify_action=None):
notify_actions = get_notify_actions()
- where_action = ''
- if notify_action and notify_action in notify_actions:
- where_action = 'WHERE %s = 1 ' % notify_action
+ where = where_id = where_action = ''
+ if notifier_id or notify_action:
+ where = 'WHERE '
+ if notifier_id:
+ where_id += 'notifier_id = %s' % notifier_id
+ if notify_action and notify_action in notify_actions:
+ where_action = '%s = 1' % notify_action
+ where += ' AND '.join([w for w in [where_id, where_action] if w])
monitor_db = database.MonitorDatabase()
result = monitor_db.select('SELECT id, agent_id, agent_name, agent_label, friendly_name, %s FROM notifiers %s'
- % (', '.join(notify_actions), where_action))
+ % (', '.join(notify_actions), where))
for item in result:
- item['actions'] = {k: helpers.cast_to_int(item.pop(k))
- for k in item.keys() if k in notify_actions}
+ item['active'] = int(any([item.pop(k) for k in item.keys() if k in notify_actions]))
return sorted(result, key=lambda k: (k['agent_label'], k['id']))
diff --git a/plexpy/webserve.py b/plexpy/webserve.py
index ed880fcc..3093b102 100644
--- a/plexpy/webserve.py
+++ b/plexpy/webserve.py
@@ -2863,10 +2863,7 @@ class WebInterface(object):
"agent_name": "telegram",
"agent_label": "Telegram",
"friendly_name": "",
- "actions": {"on_play": 0,
- "on_stop": 0,
- ...
- },
+ "active": 1
}
]
```