diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 486f79f7..6b7140df 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -685,6 +685,9 @@ +
+ +
diff --git a/headphones/__init__.py b/headphones/__init__.py index 4ed8c855..2066e5f9 100644 --- a/headphones/__init__.py +++ b/headphones/__init__.py @@ -248,6 +248,7 @@ PUSHOVER_ENABLED = True PUSHOVER_PRIORITY = 1 PUSHOVER_KEYS = None PUSHOVER_ONSNATCH = True +PUSHOVER_APITOKEN = None PUSHBULLET_ENABLED = True PUSHBULLET_APIKEY = None PUSHBULLET_DEVICEID = None @@ -338,7 +339,7 @@ def initialize(): NZB_DOWNLOADER, TORRENT_DOWNLOADER, PREFERRED_WORDS, REQUIRED_WORDS, IGNORED_WORDS, LASTFM_USERNAME, \ INTERFACE, FOLDER_PERMISSIONS, FILE_PERMISSIONS, ENCODERFOLDER, ENCODER_PATH, ENCODER, XLDPROFILE, BITRATE, SAMPLINGFREQUENCY, \ MUSIC_ENCODER, ADVANCEDENCODER, ENCODEROUTPUTFORMAT, ENCODERQUALITY, ENCODERVBRCBR, ENCODERLOSSLESS, DELETE_LOSSLESS_FILES, \ - PROWL_ENABLED, PROWL_PRIORITY, PROWL_KEYS, PROWL_ONSNATCH, PUSHOVER_ENABLED, PUSHOVER_PRIORITY, PUSHOVER_KEYS, PUSHOVER_ONSNATCH, MIRRORLIST, \ + PROWL_ENABLED, PROWL_PRIORITY, PROWL_KEYS, PROWL_ONSNATCH, PUSHOVER_ENABLED, PUSHOVER_PRIORITY, PUSHOVER_KEYS, PUSHOVER_ONSNATCH, PUSHOVER_APITOKEN, MIRRORLIST, \ TWITTER_ENABLED, TWITTER_ONSNATCH, TWITTER_USERNAME, TWITTER_PASSWORD, TWITTER_PREFIX, \ PUSHBULLET_ENABLED, PUSHBULLET_APIKEY, PUSHBULLET_DEVICEID, PUSHBULLET_ONSNATCH, \ MIRROR, CUSTOMHOST, CUSTOMPORT, CUSTOMSLEEP, HPUSER, HPPASS, XBMC_ENABLED, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, XBMC_UPDATE, \ @@ -571,6 +572,7 @@ def initialize(): PUSHOVER_KEYS = check_setting_str(CFG, 'Pushover', 'pushover_keys', '') PUSHOVER_ONSNATCH = bool(check_setting_int(CFG, 'Pushover', 'pushover_onsnatch', 0)) PUSHOVER_PRIORITY = check_setting_int(CFG, 'Pushover', 'pushover_priority', 0) + PUSHOVER_APITOKEN = check_setting_str(CFG, 'Pushover', 'pushover_apitoken', '') PUSHBULLET_ENABLED = bool(check_setting_int(CFG, 'PushBullet', 'pushbullet_enabled', 0)) PUSHBULLET_APIKEY = check_setting_str(CFG, 'PushBullet', 'pushbullet_apikey', '') @@ -967,6 +969,7 @@ def config_write(): new_config['Pushover']['pushover_keys'] = PUSHOVER_KEYS new_config['Pushover']['pushover_onsnatch'] = int(PUSHOVER_ONSNATCH) new_config['Pushover']['pushover_priority'] = int(PUSHOVER_PRIORITY) + new_config['Pushover']['pushover_apitoken'] = PUSHOVER_APITOKEN new_config['PushBullet'] = {} new_config['PushBullet']['pushbullet_enabled'] = int(PUSHBULLET_ENABLED) diff --git a/headphones/notifiers.py b/headphones/notifiers.py index 3da78a6e..8b204019 100644 --- a/headphones/notifiers.py +++ b/headphones/notifiers.py @@ -462,6 +462,8 @@ class PUSHOVER: self.enabled = headphones.PUSHOVER_ENABLED self.keys = headphones.PUSHOVER_KEYS self.priority = headphones.PUSHOVER_PRIORITY + if headphones.PUSHOVER_APITOKEN: + self.application_token = headphones.PUSHOVER_APITOKEN pass def conf(self, options): diff --git a/headphones/transmission.py b/headphones/transmission.py index 92073683..55449290 100644 --- a/headphones/transmission.py +++ b/headphones/transmission.py @@ -55,8 +55,8 @@ def addTorrent(link): prowl.notify(name,"Download started") if headphones.PUSHOVER_ENABLED and headphones.PUSHOVER_ONSNATCH: logger.info(u"Sending Pushover notification") - prowl = notifiers.PUSHOVER() - prowl.notify(name,"Download started") + pushover = notifiers.PUSHOVER() + pushover.notify(name,"Download started") if headphones.TWITTER_ENABLED and headphones.TWITTER_ONSNATCH: logger.info(u"Sending Twitter notification") twitter = notifiers.TwitterNotifier() diff --git a/headphones/webserve.py b/headphones/webserve.py index ca8ad578..2de324af 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -959,6 +959,7 @@ class WebInterface(object): "pushover_enabled": checked(headphones.PUSHOVER_ENABLED), "pushover_onsnatch": checked(headphones.PUSHOVER_ONSNATCH), "pushover_keys": headphones.PUSHOVER_KEYS, + "pushover_apitoken": headphones.PUSHOVER_APITOKEN, "pushover_priority": headphones.PUSHOVER_PRIORITY, "pushbullet_enabled": checked(headphones.PUSHBULLET_ENABLED), "pushbullet_onsnatch": checked(headphones.PUSHBULLET_ONSNATCH), @@ -1012,7 +1013,7 @@ class WebInterface(object): bitrate=None, samplingfrequency=None, encoderfolder=None, advancedencoder=None, encoderoutputformat=None, encodervbrcbr=None, encoderquality=None, encoderlossless=0, delete_lossless_files=0, prowl_enabled=0, prowl_onsnatch=0, prowl_keys=None, prowl_priority=0, xbmc_enabled=0, xbmc_host=None, xbmc_username=None, xbmc_password=None, xbmc_update=0, xbmc_notify=0, nma_enabled=False, nma_apikey=None, nma_priority=0, nma_onsnatch=0, pushalot_enabled=False, pushalot_apikey=None, pushalot_onsnatch=0, synoindex_enabled=False, - pushover_enabled=0, pushover_onsnatch=0, pushover_keys=None, pushover_priority=0, pushbullet_enabled=0, pushbullet_onsnatch=0, pushbullet_apikey=None, pushbullet_deviceid=None, twitter_enabled=0, twitter_onsnatch=0, mirror=None, customhost=None, customport=None, + pushover_enabled=0, pushover_onsnatch=0, pushover_keys=None, pushover_priority=0, pushover_apitoken=None, pushbullet_enabled=0, pushbullet_onsnatch=0, pushbullet_apikey=None, pushbullet_deviceid=None, twitter_enabled=0, twitter_onsnatch=0, mirror=None, customhost=None, customport=None, customsleep=None, hpuser=None, hppass=None, preferred_bitrate_high_buffer=None, preferred_bitrate_low_buffer=None, preferred_bitrate_allow_lossless=0, cache_sizemb=None, enable_https=0, https_cert=None, https_key=None, file_permissions=None, folder_permissions=None, plex_enabled=0, plex_server_host=None, plex_client_host=None, plex_username=None, plex_password=None, plex_update=0, plex_notify=0, songkick_enabled=0, songkick_apikey=None, songkick_location=None, songkick_filter_enabled=0, **kwargs): @@ -1153,6 +1154,7 @@ class WebInterface(object): headphones.PUSHOVER_ONSNATCH = pushover_onsnatch headphones.PUSHOVER_KEYS = pushover_keys headphones.PUSHOVER_PRIORITY = pushover_priority + headphones.PUSHOVER_APITOKEN = pushover_apitoken headphones.PUSHBULLET_ENABLED = pushbullet_enabled headphones.PUSHBULLET_ONSNATCH = pushbullet_onsnatch headphones.PUSHBULLET_APIKEY = pushbullet_apikey