From 3299ec7c82e02133fb7b5a4dd4f11bf0b3310c94 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Mon, 12 Oct 2015 00:54:26 -0700 Subject: [PATCH] Clean up Pushover sound code --- plexpy/notifiers.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/plexpy/notifiers.py b/plexpy/notifiers.py index afeb4d69..6f3e879b 100644 --- a/plexpy/notifiers.py +++ b/plexpy/notifiers.py @@ -914,18 +914,16 @@ class PUSHOVER(object): if request_status == 200: data = json.loads(response.read()) sounds = data.get('sounds', {}) + sounds.update({'': ''}) return sounds elif request_status >= 400 and request_status < 500: - logger.info(u"Unable to retrieve Pushover notification sounds: %s" % response.reason) - return {} + logger.info(u"Unable to retrieve Pushover notification sounds list: %s" % response.reason) + return {'': ''} else: - logger.info(u"Unable to retrieve Pushover notification sounds.") - return {} + logger.info(u"Unable to retrieve Pushover notification sounds list.") + return {'': ''} def return_config_options(self): - sounds = self.get_sounds() - sounds[''] = '' - config_option = [{'label': 'Pushover User Key', 'value': self.keys, 'name': 'pushover_keys', @@ -944,7 +942,7 @@ class PUSHOVER(object): 'name': 'pushover_sound', 'description': 'Set the notification sound. Leave blank for the default sound.', 'input_type': 'select', - 'select_options': sounds + 'select_options': self.get_sounds() }, {'label': 'Pushover API Token', 'value': plexpy.CONFIG.PUSHOVER_APITOKEN,