diff --git a/data/interfaces/default/notification_config.html b/data/interfaces/default/notification_config.html index c61740fb..9c41a9bd 100644 --- a/data/interfaces/default/notification_config.html +++ b/data/interfaces/default/notification_config.html @@ -80,38 +80,29 @@ from plexpy import helpers

Set a custom body.

%if agent['name'] == 'Scripts': -
- - -

Pick your script

-
-

Pick your action

+

Choose a notification action.

-

Set a custom script args: -zomg --x.

+

Set custom script arguments: -zomg --x.

% endif
@@ -185,7 +176,6 @@ from plexpy import helpers subject: $('#test_subject').val(), body: $('#test_body').val(), notify_action: $('#test_script_action').val(), - script: $('#test_script').val(), script_args: $('#test_script_args').val() }, cache: false, async: true, @@ -196,13 +186,7 @@ from plexpy import helpers }); }); - $('#pushbullet_apikey, #pushover_apitoken').on('change', function () { - doAjaxCall('set_notification_config', $(this), 'tabs', true); - reloadModal(); - return false; - }); - - $('#scripts_folder').on('change', function () { + $('#pushbullet_apikey, #pushover_apitoken, #scripts_folder').on('change', function () { doAjaxCall('set_notification_config', $(this), 'tabs', true); reloadModal(); return false; diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 2bf3b653..c4dbe142 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1014,6 +1014,14 @@ available_notification_agents = sorted(notifiers.available_notification_agents() + + {streams} + The number of concurrent streams. + + + {action} + The action that triggered the notification. + {user} The username of the person streaming. @@ -1126,14 +1134,6 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {transcode_audio_channels} The audio channels of the transcoded media. - - {streams} - The number of concurrent streams. - - - {action} - The action that trigged the notification. - diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index f642fac6..ae722368 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -516,6 +516,8 @@ def build_notify_text(session=None, timeline=None, state=None): available_params = {'server_name': server_name, 'server_uptime': server_uptime, + 'streams': stream_count, + 'action': state, 'user': user, 'platform': platform, 'player': player, @@ -564,9 +566,7 @@ def build_notify_text(session=None, timeline=None, state=None): 'summary': metadata['summary'], 'tagline': metadata['tagline'], 'rating': metadata['rating'], - 'duration': duration, - 'action': state, - 'streams': stream_count + 'duration': duration } # Default subject text @@ -780,6 +780,7 @@ def build_server_notify_text(state=None): on_extup_body = plexpy.CONFIG.NOTIFY_ON_EXTUP_BODY_TEXT on_intup_subject = plexpy.CONFIG.NOTIFY_ON_INTUP_SUBJECT_TEXT on_intup_body = plexpy.CONFIG.NOTIFY_ON_INTUP_BODY_TEXT + script_args_text = plexpy.CONFIG.NOTIFY_SCRIPTS_ARGS_TEXT available_params = {'server_name': server_name, 'server_uptime': server_uptime, @@ -790,7 +791,6 @@ def build_server_notify_text(state=None): # Default scripts args script_args = [] - script_args_text = plexpy.CONFIG.NOTIFY_SCRIPTS_ARGS_TEXT # Regex to match {param} but not "{param}" params_to_quote = re.compile(r'(?