diff --git a/data/interfaces/default/notifier_config.html b/data/interfaces/default/notifier_config.html index 22d62be2..16c406bc 100644 --- a/data/interfaces/default/notifier_config.html +++ b/data/interfaces/default/notifier_config.html @@ -606,6 +606,22 @@ }); }); + % elif notifier['agent_name'] == 'pushover': + function pushoverPriority() { + if ($('#pushover_priority').val() == '2') { + $('#pushover_retry').closest('.form-group').show(); + $('#pushover_expire').closest('.form-group').show(); + } else { + $('#pushover_retry').closest('.form-group').hide(); + $('#pushover_expire').closest('.form-group').hide(); + } + } + + pushoverPriority(); + $('#pushover_priority').change( function () { + pushoverPriority(); + }); + % endif function validateLogic() { diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index 6a294970..bc7237a0 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -2691,8 +2691,10 @@ class PUSHOVER(Notifier): _DEFAULT_CONFIG = {'api_token': '', 'key': '', 'html_support': 1, - 'priority': 0, 'sound': '', + 'priority': 0, + 'retry': 30, + 'expire': 3600, 'incl_url': 1, 'incl_subject': 1, 'incl_poster': 0, @@ -2713,6 +2715,10 @@ class PUSHOVER(Notifier): if self.config['incl_subject']: data['title'] = subject.encode("utf-8") + if self.config['priority'] == 2: + data['retry'] = max(30, self.config['retry']) + data['expire'] = max(30, self.config['expire']) + headers = {'Content-type': 'application/x-www-form-urlencoded'} files = {} @@ -2789,6 +2795,13 @@ class PUSHOVER(Notifier): 'description': 'Your Pushover user or group key.', 'input_type': 'text' }, + {'label': 'Sound', + 'value': self.config['sound'], + 'name': 'pushover_sound', + 'description': 'Set the notification sound. Leave blank for the default sound.', + 'input_type': 'select', + 'select_options': self.get_sounds() + }, {'label': 'Priority', 'value': self.config['priority'], 'name': 'pushover_priority', @@ -2796,12 +2809,19 @@ class PUSHOVER(Notifier): 'input_type': 'select', 'select_options': {-2: -2, -1: -1, 0: 0, 1: 1, 2: 2} }, - {'label': 'Sound', - 'value': self.config['sound'], - 'name': 'pushover_sound', - 'description': 'Set the notification sound. Leave blank for the default sound.', - 'input_type': 'select', - 'select_options': self.get_sounds() + {'label': 'Retry Interval', + 'value': self.config['retry'], + 'name': 'pushover_retry', + 'description': 'Set the interval in seconds to keep retrying the notification.
' + 'Note: For priority 2 only. Minimum 30 seconds.', + 'input_type': 'number' + }, + {'label': 'Expire Duration', + 'value': self.config['expire'], + 'name': 'pushover_expire', + 'description': 'Set the duration in seconds when the notification will stop retrying.
' + 'Note: For priority 2 only. Minimum 30 seconds.', + 'input_type': 'number' }, {'label': 'Enable HTML Support', 'value': self.config['html_support'],