1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 11:32:20 -05:00

Add global option to disable SickRage update notifications via notifiers.

This commit is contained in:
Mark Rawson 2014-07-03 08:16:15 +01:00
parent 6aa149752b
commit 8f19e84a80
4 changed files with 17 additions and 5 deletions

View File

@ -92,13 +92,20 @@
<input type="checkbox" name="auto_update" id="auto_update" #if $sickbeard.AUTO_UPDATE then "checked=\"checked\"" else ""#/> <input type="checkbox" name="auto_update" id="auto_update" #if $sickbeard.AUTO_UPDATE then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="auto_update"> <label class="clearfix" for="auto_update">
<span class="component-title">Automatic Updates</span> <span class="component-title">Automatic Updates</span>
<span class="component-desc">Automatically get and install updates for SickRage when available. These</span> <span class="component-desc">Automatically get and install updates for SickRage when available.</span>
</label> </label>
<label class="nocheck clearfix"> <label class="nocheck clearfix">
<span class="component-title">&nbsp;</span> <span class="component-title">&nbsp;</span>
<span class="component-desc">updates run on startup and in the background on the interval specified above.</span> <span class="component-desc">updates run on startup and in the background on the interval specified above.</span>
</label> </label>
</div> </div>
<div class="field-pair">
<input type="checkbox" name="notify_on_update" id="notify_on_update" #if $sickbeard.NOTIFY_ON_UPDATE then "checked=\"checked\"" else ""#/>
<label class="clearfix" for="notify_on_update">
<span class="component-title">Notify on Update</span>
<span class="component-desc">Sends the notification SickRage has been updated to all enabled notifiers.</span>
</label>
</div>
<div class="field-pair"> <div class="field-pair">
<input type="checkbox" name="sort_article" id="sort_article" #if $sickbeard.SORT_ARTICLE then "checked=\"checked\"" else ""#/> <input type="checkbox" name="sort_article" id="sort_article" #if $sickbeard.SORT_ARTICLE then "checked=\"checked\"" else ""#/>

View File

@ -100,6 +100,7 @@ NEWEST_VERSION = None
NEWEST_VERSION_STRING = None NEWEST_VERSION_STRING = None
VERSION_NOTIFY = None VERSION_NOTIFY = None
AUTO_UPDATE = None AUTO_UPDATE = None
NOTIFY_ON_UPDATE = None
CUR_COMMIT_HASH = None CUR_COMMIT_HASH = None
INIT_LOCK = Lock() INIT_LOCK = Lock()
@ -457,7 +458,7 @@ def initialize(consoleLogging=True):
USE_NMA, NMA_NOTIFY_ONSNATCH, NMA_NOTIFY_ONDOWNLOAD, NMA_NOTIFY_ONSUBTITLEDOWNLOAD, NMA_API, NMA_PRIORITY, \ USE_NMA, NMA_NOTIFY_ONSNATCH, NMA_NOTIFY_ONDOWNLOAD, NMA_NOTIFY_ONSUBTITLEDOWNLOAD, NMA_API, NMA_PRIORITY, \
USE_PUSHALOT, PUSHALOT_NOTIFY_ONSNATCH, PUSHALOT_NOTIFY_ONDOWNLOAD, PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHALOT_AUTHORIZATIONTOKEN, \ USE_PUSHALOT, PUSHALOT_NOTIFY_ONSNATCH, PUSHALOT_NOTIFY_ONDOWNLOAD, PUSHALOT_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHALOT_AUTHORIZATIONTOKEN, \
USE_PUSHBULLET, PUSHBULLET_NOTIFY_ONSNATCH, PUSHBULLET_NOTIFY_ONDOWNLOAD, PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHBULLET_API, PUSHBULLET_DEVICE, \ USE_PUSHBULLET, PUSHBULLET_NOTIFY_ONSNATCH, PUSHBULLET_NOTIFY_ONDOWNLOAD, PUSHBULLET_NOTIFY_ONSUBTITLEDOWNLOAD, PUSHBULLET_API, PUSHBULLET_DEVICE, \
versionCheckScheduler, VERSION_NOTIFY, AUTO_UPDATE, PROCESS_AUTOMATICALLY, UNPACK, CPU_PRESET, \ versionCheckScheduler, VERSION_NOTIFY, AUTO_UPDATE, NOTIFY_ON_UPDATE, PROCESS_AUTOMATICALLY, UNPACK, CPU_PRESET, \
KEEP_PROCESSED_DIR, PROCESS_METHOD, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \ KEEP_PROCESSED_DIR, PROCESS_METHOD, TV_DOWNLOAD_DIR, MIN_DAILYSEARCH_FREQUENCY, DEFAULT_UPDATE_FREQUENCY, MIN_UPDATE_FREQUENCY, UPDATE_FREQUENCY, \
showQueueScheduler, searchQueueScheduler, ROOT_DIRS, CACHE_DIR, ACTUAL_CACHE_DIR, TIMEZONE_DISPLAY, \ showQueueScheduler, searchQueueScheduler, ROOT_DIRS, CACHE_DIR, ACTUAL_CACHE_DIR, TIMEZONE_DISPLAY, \
NAMING_PATTERN, NAMING_MULTI_EP, NAMING_FORCE_FOLDERS, NAMING_ABD_PATTERN, NAMING_CUSTOM_ABD, NAMING_SPORTS_PATTERN, NAMING_CUSTOM_SPORTS, NAMING_STRIP_YEAR, \ NAMING_PATTERN, NAMING_MULTI_EP, NAMING_FORCE_FOLDERS, NAMING_ABD_PATTERN, NAMING_CUSTOM_ABD, NAMING_SPORTS_PATTERN, NAMING_CUSTOM_SPORTS, NAMING_STRIP_YEAR, \
@ -589,6 +590,7 @@ def initialize(consoleLogging=True):
STATUS_DEFAULT = check_setting_int(CFG, 'General', 'status_default', SKIPPED) STATUS_DEFAULT = check_setting_int(CFG, 'General', 'status_default', SKIPPED)
VERSION_NOTIFY = check_setting_int(CFG, 'General', 'version_notify', 1) VERSION_NOTIFY = check_setting_int(CFG, 'General', 'version_notify', 1)
AUTO_UPDATE = check_setting_int(CFG, 'General', 'auto_update', 0) AUTO_UPDATE = check_setting_int(CFG, 'General', 'auto_update', 0)
NOTIFY_ON_UPDATE = check_setting_int(CFG, 'General', 'notify_on_update', 1)
FLATTEN_FOLDERS_DEFAULT = bool(check_setting_int(CFG, 'General', 'flatten_folders_default', 0)) FLATTEN_FOLDERS_DEFAULT = bool(check_setting_int(CFG, 'General', 'flatten_folders_default', 0))
INDEXER_DEFAULT = check_setting_int(CFG, 'General', 'indexer_default', 0) INDEXER_DEFAULT = check_setting_int(CFG, 'General', 'indexer_default', 0)
INDEXER_TIMEOUT = check_setting_int(CFG, 'General', 'indexer_timeout', 10) INDEXER_TIMEOUT = check_setting_int(CFG, 'General', 'indexer_timeout', 10)
@ -1388,6 +1390,7 @@ def save_config():
new_config['General']['provider_order'] = ' '.join(PROVIDER_ORDER) new_config['General']['provider_order'] = ' '.join(PROVIDER_ORDER)
new_config['General']['version_notify'] = int(VERSION_NOTIFY) new_config['General']['version_notify'] = int(VERSION_NOTIFY)
new_config['General']['auto_update'] = int(AUTO_UPDATE) new_config['General']['auto_update'] = int(AUTO_UPDATE)
new_config['General']['notify_on_update'] = int(NOTIFY_ON_UPDATE)
new_config['General']['naming_strip_year'] = int(NAMING_STRIP_YEAR) new_config['General']['naming_strip_year'] = int(NAMING_STRIP_YEAR)
new_config['General']['naming_pattern'] = NAMING_PATTERN new_config['General']['naming_pattern'] = NAMING_PATTERN
new_config['General']['naming_custom_abd'] = int(NAMING_CUSTOM_ABD) new_config['General']['naming_custom_abd'] = int(NAMING_CUSTOM_ABD)

View File

@ -103,5 +103,6 @@ def notify_snatch(ep_name):
n.notify_snatch(ep_name) n.notify_snatch(ep_name)
def notify_sickrage_update(new_version = ""): def notify_sickrage_update(new_version = ""):
if sickbeard.NOTIFY_ON_UPDATE:
for n in notifiers: for n in notifiers:
n.notify_sickrage_update(new_version) n.notify_sickrage_update(new_version)

View File

@ -1401,7 +1401,7 @@ class ConfigGeneral(MainHandler):
update_shows_on_start=None, update_frequency=None, launch_browser=None, web_username=None, update_shows_on_start=None, update_frequency=None, launch_browser=None, web_username=None,
use_api=None, api_key=None, indexer_default=None, timezone_display=None, cpu_preset=None, use_api=None, api_key=None, indexer_default=None, timezone_display=None, cpu_preset=None,
web_password=None, version_notify=None, enable_https=None, https_cert=None, https_key=None, web_password=None, version_notify=None, enable_https=None, https_cert=None, https_key=None,
handle_reverse_proxy=None, sort_article=None, auto_update=None, proxy_setting=None, handle_reverse_proxy=None, sort_article=None, auto_update=None, notify_on_update=None, proxy_setting=None,
anon_redirect=None, git_path=None, calendar_unprotected=None, anon_redirect=None, git_path=None, calendar_unprotected=None,
fuzzy_dating=None, trim_zero=None, date_preset=None, date_preset_na=None, time_preset=None, fuzzy_dating=None, trim_zero=None, date_preset=None, date_preset_na=None, time_preset=None,
indexer_timeout=None): indexer_timeout=None):
@ -1412,6 +1412,7 @@ class ConfigGeneral(MainHandler):
sickbeard.LAUNCH_BROWSER = config.checkbox_to_value(launch_browser) sickbeard.LAUNCH_BROWSER = config.checkbox_to_value(launch_browser)
config.change_VERSION_NOTIFY(config.checkbox_to_value(version_notify)) config.change_VERSION_NOTIFY(config.checkbox_to_value(version_notify))
sickbeard.AUTO_UPDATE = config.checkbox_to_value(auto_update) sickbeard.AUTO_UPDATE = config.checkbox_to_value(auto_update)
sickbeard.NOTIFY_ON_UPDATE = config.checkbox_to_value(notify_on_update)
# sickbeard.LOG_DIR is set in config.change_LOG_DIR() # sickbeard.LOG_DIR is set in config.change_LOG_DIR()
sickbeard.UPDATE_SHOWS_ON_START = config.checkbox_to_value(update_shows_on_start) sickbeard.UPDATE_SHOWS_ON_START = config.checkbox_to_value(update_shows_on_start)