SABnzbd-Suite: perform "Keep awake while downloading" and "Wake up periodically" only if sabnzbd is enabled

This commit is contained in:
queeup 2012-06-24 18:15:44 +03:00 committed by Stefan Saraev
parent de97e4f71a
commit ac530bc48b
3 changed files with 43 additions and 38 deletions

View File

@ -1,6 +1,7 @@
2.1.7
- update to SABnzbd-0.7.0
- update to Headphones-89c2a8c
- perform "Keep awake while downloading" and "Wake up periodically" only if sabnzbd is enabled
2.1.6
- fixed another startup bug

View File

@ -61,6 +61,9 @@ sabNzbdQueue = 'http://' + sabNzbdAddress + '/sabnzbd/api?mode=queue&output
# start checking SABnzbd for activity and prevent sleeping if necessary
socket.setdefaulttimeout(timeout)
# check for launching sabnzbd
sabNzbdLaunch = (__settings__.getSetting('SABNZBD_LAUNCH').lower() == 'true')
# perform some initial checks and log essential settings
shouldKeepAwake = (__settings__.getSetting('SABNZBD_KEEP_AWAKE').lower() == 'true')
wakePeriodically = (__settings__.getSetting('SABNZBD_PERIODIC_WAKE').lower() == 'true')
@ -73,6 +76,7 @@ if wakePeriodically:
while (not xbmc.abortRequested):
if sabNzbdLaunch:
# reread setting in case it has changed
shouldKeepAwake = (__settings__.getSetting('SABNZBD_KEEP_AWAKE').lower() == 'true')
wakePeriodically = (__settings__.getSetting('SABNZBD_PERIODIC_WAKE').lower() == 'true')

View File

@ -19,8 +19,8 @@
<setting label="3010" type="lsep"/>
<setting type="sep" />
<setting id="SABNZBD_KEEP_AWAKE" type="bool" label="3021" default="false"/>
<setting id="SABNZBD_PERIODIC_WAKE" type="bool" label="3030" default="false"/>
<setting id="SABNZBD_KEEP_AWAKE" type="bool" label="3021" default="false" enable="eq(-10,true)" />
<setting id="SABNZBD_PERIODIC_WAKE" type="bool" label="3030" default="false" enable="eq(-11,true)" />
<setting id="SABNZBD_WAKE_AT" type="enum" subsetting="true" enable="eq(-1,true)"
label="3031" default="01"
values="|01:00|03:00|05:00|07:00|09:00|11:00|13:00|15:00|17:00|19:00|21:00|23:00"/>