mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-12 00:06:07 -07:00
Clean up Pushover sound code
This commit is contained in:
parent
c25c48c1a6
commit
3299ec7c82
1 changed files with 6 additions and 8 deletions
|
@ -914,18 +914,16 @@ class PUSHOVER(object):
|
||||||
if request_status == 200:
|
if request_status == 200:
|
||||||
data = json.loads(response.read())
|
data = json.loads(response.read())
|
||||||
sounds = data.get('sounds', {})
|
sounds = data.get('sounds', {})
|
||||||
|
sounds.update({'': ''})
|
||||||
return sounds
|
return sounds
|
||||||
elif request_status >= 400 and request_status < 500:
|
elif request_status >= 400 and request_status < 500:
|
||||||
logger.info(u"Unable to retrieve Pushover notification sounds: %s" % response.reason)
|
logger.info(u"Unable to retrieve Pushover notification sounds list: %s" % response.reason)
|
||||||
return {}
|
return {'': ''}
|
||||||
else:
|
else:
|
||||||
logger.info(u"Unable to retrieve Pushover notification sounds.")
|
logger.info(u"Unable to retrieve Pushover notification sounds list.")
|
||||||
return {}
|
return {'': ''}
|
||||||
|
|
||||||
def return_config_options(self):
|
def return_config_options(self):
|
||||||
sounds = self.get_sounds()
|
|
||||||
sounds[''] = ''
|
|
||||||
|
|
||||||
config_option = [{'label': 'Pushover User Key',
|
config_option = [{'label': 'Pushover User Key',
|
||||||
'value': self.keys,
|
'value': self.keys,
|
||||||
'name': 'pushover_keys',
|
'name': 'pushover_keys',
|
||||||
|
@ -944,7 +942,7 @@ class PUSHOVER(object):
|
||||||
'name': 'pushover_sound',
|
'name': 'pushover_sound',
|
||||||
'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': sounds
|
'select_options': self.get_sounds()
|
||||||
},
|
},
|
||||||
{'label': 'Pushover API Token',
|
{'label': 'Pushover API Token',
|
||||||
'value': plexpy.CONFIG.PUSHOVER_APITOKEN,
|
'value': plexpy.CONFIG.PUSHOVER_APITOKEN,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue