mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Remove PlexPy Pushover API token
* User's own API token is now required
This commit is contained in:
parent
f31c4dcccd
commit
6d5b5e15d5
3 changed files with 29 additions and 34 deletions
|
@ -158,12 +158,7 @@ from plexpy import helpers
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#testSlack').click(function() {
|
$('#pushbullet_apikey, #pushover_apitoken').on('change', function () {
|
||||||
$.get("/test_slack", function(data) { $('#ajaxMsg').html("<i class='fa fa-check'></i>" + data); });
|
|
||||||
$('#ajaxMsg').addClass('success').fadeIn().delay(3000).fadeOut();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#pushbullet_apikey').on('change', function () {
|
|
||||||
doAjaxCall('set_notification_config', $(this), 'tabs', true);
|
doAjaxCall('set_notification_config', $(this), 'tabs', true);
|
||||||
reloadModal();
|
reloadModal();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -983,15 +983,11 @@ class PUSHOVER(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.enabled = plexpy.CONFIG.PUSHOVER_ENABLED
|
self.enabled = plexpy.CONFIG.PUSHOVER_ENABLED
|
||||||
|
self.application_token = plexpy.CONFIG.PUSHOVER_APITOKEN
|
||||||
self.keys = plexpy.CONFIG.PUSHOVER_KEYS
|
self.keys = plexpy.CONFIG.PUSHOVER_KEYS
|
||||||
self.priority = plexpy.CONFIG.PUSHOVER_PRIORITY
|
self.priority = plexpy.CONFIG.PUSHOVER_PRIORITY
|
||||||
self.sound = plexpy.CONFIG.PUSHOVER_SOUND
|
self.sound = plexpy.CONFIG.PUSHOVER_SOUND
|
||||||
|
|
||||||
if plexpy.CONFIG.PUSHOVER_APITOKEN:
|
|
||||||
self.application_token = plexpy.CONFIG.PUSHOVER_APITOKEN
|
|
||||||
else:
|
|
||||||
self.application_token = "aVny3NZFwZaXC642c831b4wd7KUhQS"
|
|
||||||
|
|
||||||
def conf(self, options):
|
def conf(self, options):
|
||||||
return cherrypy.config['config'].get('Pushover', options)
|
return cherrypy.config['config'].get('Pushover', options)
|
||||||
|
|
||||||
|
@ -1041,6 +1037,7 @@ class PUSHOVER(object):
|
||||||
self.notify('Main Screen Activate', 'Test Message')
|
self.notify('Main Screen Activate', 'Test Message')
|
||||||
|
|
||||||
def get_sounds(self):
|
def get_sounds(self):
|
||||||
|
if plexpy.CONFIG.PUSHOVER_APITOKEN:
|
||||||
http_handler = HTTPSConnection("api.pushover.net")
|
http_handler = HTTPSConnection("api.pushover.net")
|
||||||
http_handler.request("GET", "/1/sounds.json?token=" + self.application_token)
|
http_handler.request("GET", "/1/sounds.json?token=" + self.application_token)
|
||||||
response = http_handler.getresponse()
|
response = http_handler.getresponse()
|
||||||
|
@ -1058,8 +1055,17 @@ class PUSHOVER(object):
|
||||||
logger.info(u"Unable to retrieve Pushover notification sounds list.")
|
logger.info(u"Unable to retrieve Pushover notification sounds list.")
|
||||||
return {'': ''}
|
return {'': ''}
|
||||||
|
|
||||||
|
else:
|
||||||
|
return {'': ''}
|
||||||
|
|
||||||
def return_config_options(self):
|
def return_config_options(self):
|
||||||
config_option = [{'label': 'Pushover User or Group Key',
|
config_option = [{'label': 'Pushover API Token',
|
||||||
|
'value': plexpy.CONFIG.PUSHOVER_APITOKEN,
|
||||||
|
'name': 'pushover_apitoken',
|
||||||
|
'description': 'Your Pushover API token.',
|
||||||
|
'input_type': 'text'
|
||||||
|
},
|
||||||
|
{'label': 'Pushover User or Group Key',
|
||||||
'value': self.keys,
|
'value': self.keys,
|
||||||
'name': 'pushover_keys',
|
'name': 'pushover_keys',
|
||||||
'description': 'Your Pushover user or group key.',
|
'description': 'Your Pushover user or group key.',
|
||||||
|
@ -1078,12 +1084,6 @@ class PUSHOVER(object):
|
||||||
'description': 'Set the notification sound. Leave blank for the default sound.',
|
'description': 'Set the notification sound. Leave blank for the default sound.',
|
||||||
'input_type': 'select',
|
'input_type': 'select',
|
||||||
'select_options': self.get_sounds()
|
'select_options': self.get_sounds()
|
||||||
},
|
|
||||||
{'label': 'Pushover API Token',
|
|
||||||
'value': plexpy.CONFIG.PUSHOVER_APITOKEN,
|
|
||||||
'name': 'pushover_apitoken',
|
|
||||||
'description': 'Your Pushover API token. Leave blank to use PlexPy default.',
|
|
||||||
'input_type': 'text'
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue