Remove PlexPy Pushover API token

* User's own API token is now required
This commit is contained in:
JonnyWong16 2015-12-30 15:50:42 -08:00
parent f31c4dcccd
commit 6d5b5e15d5
3 changed files with 29 additions and 34 deletions

View file

@ -158,12 +158,7 @@ from plexpy import helpers
});
});
$('#testSlack').click(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 () {
$('#pushbullet_apikey, #pushover_apitoken').on('change', function () {
doAjaxCall('set_notification_config', $(this), 'tabs', true);
reloadModal();
return false;

View file

@ -983,15 +983,11 @@ class PUSHOVER(object):
def __init__(self):
self.enabled = plexpy.CONFIG.PUSHOVER_ENABLED
self.application_token = plexpy.CONFIG.PUSHOVER_APITOKEN
self.keys = plexpy.CONFIG.PUSHOVER_KEYS
self.priority = plexpy.CONFIG.PUSHOVER_PRIORITY
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):
return cherrypy.config['config'].get('Pushover', options)
@ -1041,6 +1037,7 @@ class PUSHOVER(object):
self.notify('Main Screen Activate', 'Test Message')
def get_sounds(self):
if plexpy.CONFIG.PUSHOVER_APITOKEN:
http_handler = HTTPSConnection("api.pushover.net")
http_handler.request("GET", "/1/sounds.json?token=" + self.application_token)
response = http_handler.getresponse()
@ -1058,8 +1055,17 @@ class PUSHOVER(object):
logger.info(u"Unable to retrieve Pushover notification sounds list.")
return {'': ''}
else:
return {'': ''}
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,
'name': 'pushover_keys',
'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.',
'input_type': 'select',
'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'
}
]