1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-11-15 22:05:02 -05:00

Merge pull request #471 from pmaciocia/xbmc_always_on_315

backport: xbmc always on option - fix #315
This commit is contained in:
Nils 2014-05-08 23:39:59 +02:00
commit 0b81e63bba
4 changed files with 17 additions and 6 deletions

View File

@ -41,6 +41,13 @@
</div>
<div id="content_use_xbmc">
<div class="field-pair">
<input type="checkbox" name="xbmc_always_on" id="xbmc_always_on" #if $sickbeard.XBMC_ALWAYS_ON then "checked=\"checked\"" else ""# />
<label class="clearfix" for="xbmc_always_on">
<span class="component-title">Always On</span>
<span class="component-desc">Log errors when unreachable?</span>
</label>
</div>
<div class="field-pair">
<input type="checkbox" name="xbmc_notify_onsnatch" id="xbmc_notify_onsnatch" #if $sickbeard.XBMC_NOTIFY_ONSNATCH then "checked=\"checked\"" else ""# />
<label class="clearfix" for="xbmc_notify_onsnatch">

View File

@ -292,6 +292,7 @@ TORRENT_HIGH_BANDWIDTH = False
TORRENT_LABEL = ''
USE_XBMC = False
XBMC_ALWAYS_ON = True
XBMC_NOTIFY_ONSNATCH = False
XBMC_NOTIFY_ONDOWNLOAD = False
XBMC_NOTIFY_ONSUBTITLEDOWNLOAD = False
@ -475,7 +476,7 @@ def initialize(consoleLogging=True):
SAB_USERNAME, SAB_PASSWORD, SAB_APIKEY, SAB_CATEGORY, SAB_HOST, \
NZBGET_USERNAME, NZBGET_PASSWORD, NZBGET_CATEGORY, NZBGET_HOST, NZBGET_USE_HTTPS, currentSearchScheduler, backlogSearchScheduler, \
TORRENT_USERNAME, TORRENT_PASSWORD, TORRENT_HOST, TORRENT_PATH, TORRENT_RATIO, TORRENT_SEED_TIME, TORRENT_PAUSED, TORRENT_HIGH_BANDWIDTH, TORRENT_LABEL, \
USE_XBMC, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \
USE_XBMC, XBMC_ALWAYS_ON, XBMC_NOTIFY_ONSNATCH, XBMC_NOTIFY_ONDOWNLOAD, XBMC_NOTIFY_ONSUBTITLEDOWNLOAD, XBMC_UPDATE_FULL, XBMC_UPDATE_ONLYFIRST, \
XBMC_UPDATE_LIBRARY, XBMC_HOST, XBMC_USERNAME, XBMC_PASSWORD, \
USE_TRAKT, TRAKT_USERNAME, TRAKT_PASSWORD, TRAKT_API, TRAKT_REMOVE_WATCHLIST, TRAKT_USE_WATCHLIST, TRAKT_METHOD_ADD, TRAKT_START_PAUSED, traktWatchListCheckerSchedular, \
USE_PLEX, PLEX_NOTIFY_ONSNATCH, PLEX_NOTIFY_ONDOWNLOAD, PLEX_NOTIFY_ONSUBTITLEDOWNLOAD, PLEX_UPDATE_LIBRARY, \
@ -781,6 +782,7 @@ def initialize(consoleLogging=True):
TORRENT_LABEL = check_setting_str(CFG, 'TORRENT', 'torrent_label', '')
USE_XBMC = bool(check_setting_int(CFG, 'XBMC', 'use_xbmc', 0))
XBMC_ALWAYS_ON = bool(check_setting_int(CFG, 'XBMC', 'xbmc_always_on', 1))
XBMC_NOTIFY_ONSNATCH = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_onsnatch', 0))
XBMC_NOTIFY_ONDOWNLOAD = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_ondownload', 0))
XBMC_NOTIFY_ONSUBTITLEDOWNLOAD = bool(check_setting_int(CFG, 'XBMC', 'xbmc_notify_onsubtitledownload', 0))
@ -1526,6 +1528,7 @@ def save_config():
new_config['XBMC'] = {}
new_config['XBMC']['use_xbmc'] = int(USE_XBMC)
new_config['XBMC']['xbmc_always_on'] = int(XBMC_ALWAYS_ON)
new_config['XBMC']['xbmc_notify_onsnatch'] = int(XBMC_NOTIFY_ONSNATCH)
new_config['XBMC']['xbmc_notify_ondownload'] = int(XBMC_NOTIFY_ONDOWNLOAD)
new_config['XBMC']['xbmc_notify_onsubtitledownload'] = int(XBMC_NOTIFY_ONSUBTITLEDOWNLOAD)

View File

@ -146,8 +146,8 @@ class XBMCNotifier:
if notifyResult:
result += curHost + ':' + notifyResult["result"].decode(sickbeard.SYS_ENCODING)
else:
logger.log(u"Failed to detect XBMC version for '" + curHost + "', check configuration and try again.",
logger.ERROR)
if sickbeard.XBMC_ALWAYS_ON or force:
logger.log(u"Failed to detect XBMC version for '" + curHost + "', check configuration and try again.", logger.ERROR)
result += curHost + ':False'
return result
@ -542,8 +542,8 @@ class XBMCNotifier:
logger.DEBUG)
return True
else:
logger.log(u"Failed to detect XBMC version for '" + host + "', check configuration and try again.",
logger.ERROR)
if sickbeard.XBMC_ALWAYS_ON:
logger.log(u"Failed to detect XBMC version for '" + curHost + "', check configuration and try again.", logger.ERROR)
result = result + 1
# needed for the 'update xbmc' submenu command

View File

@ -1650,7 +1650,7 @@ class ConfigNotifications:
return _munge(t)
@cherrypy.expose
def saveNotifications(self, use_xbmc=None, xbmc_notify_onsnatch=None, xbmc_notify_ondownload=None,
def saveNotifications(self, use_xbmc=None, xbmc_always_on=None, xbmc_notify_onsnatch=None, xbmc_notify_ondownload=None,
xbmc_notify_onsubtitledownload=None, xbmc_update_onlyfirst=None,
xbmc_update_library=None, xbmc_update_full=None, xbmc_host=None, xbmc_username=None,
xbmc_password=None,
@ -1696,6 +1696,7 @@ class ConfigNotifications:
results = []
sickbeard.USE_XBMC = config.checkbox_to_value(use_xbmc)
sickbeard.XBMC_ALWAYS_ON = config.checkbox_to_value(xbmc_always_on)
sickbeard.XBMC_NOTIFY_ONSNATCH = config.checkbox_to_value(xbmc_notify_onsnatch)
sickbeard.XBMC_NOTIFY_ONDOWNLOAD = config.checkbox_to_value(xbmc_notify_ondownload)
sickbeard.XBMC_NOTIFY_ONSUBTITLEDOWNLOAD = config.checkbox_to_value(xbmc_notify_onsubtitledownload)