mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-06 03:39:51 +01:00
Merge remote-tracking branch 'gotson/pushover-override' into develop
This commit is contained in:
@@ -685,6 +685,9 @@
|
||||
<label>Priority (-1,0, or 1):</label>
|
||||
<input type="text" name="pushover_priority" value="${config['pushover_priority']}" size="2">
|
||||
</div>
|
||||
<div class="row">
|
||||
<label>API Token (leave blank to use Headphones default):</label><input type="text" name="pushover_apitoken" value="${config['pushover_apitoken']}" size="50">
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user