Revert "SABnzbd-Suite: SABnzbd should always start"

This reverts commit 59c434117146dc492e4af994193c7ff129094ed4.

Conflicts:

	packages/addons/service/downloadmanager/SABnzbd-Suite/source/bin/SABnzbd-Suite.py
This commit is contained in:
Stefan Saraev 2012-06-21 11:02:13 +03:00
parent b3c95cce99
commit 8dfbdba67b
4 changed files with 39 additions and 28 deletions

View File

@ -5,6 +5,7 @@
<setting id="SABNZBD_KEEP_AWAKE" value="false" />
<setting id="SABNZBD_PERIODIC_WAKE" value="false" />
<setting id="SABNZBD_WAKE_AT" value="1" />
<setting id="SABNZBD_LAUNCH" value="true" />
<setting id="SICKBEARD_LAUNCH" value="true" />
<setting id="COUCHPOTATO_LAUNCH" value="true" />
<setting id="COUCHPOTATO_VERSION" value="0" />

View File

@ -138,6 +138,7 @@ user = getAddonSetting(suiteSettings, 'SABNZBD_USER')
pwd = getAddonSetting(suiteSettings, 'SABNZBD_PWD')
host = getAddonSetting(suiteSettings, 'SABNZBD_IP')
sabNzbdKeepAwake = getAddonSetting(suiteSettings, 'SABNZBD_KEEP_AWAKE')
sabnzbd_launch = getAddonSetting(suiteSettings, 'SABNZBD_LAUNCH')
sickbeard_launch = getAddonSetting(suiteSettings, 'SICKBEARD_LAUNCH')
couchpotato_launch = getAddonSetting(suiteSettings, 'COUCHPOTATO_LAUNCH')
couchpotato_version = getAddonSetting(suiteSettings, 'COUCHPOTATO_VERSION')
@ -148,6 +149,8 @@ fDefaultSuiteSettings = open(pDefaultSuiteSettings, 'r')
data = fDefaultSuiteSettings.read()
fDefaultSuiteSettings.close
DefaultSuiteSettings = parseString(data)
if not sabnzbd_launch:
sabnzbd_launch = getAddonSetting(DefaultSuiteSettings, 'SABNZBD_LAUNCH')
if not sickbeard_launch:
sickbeard_launch = getAddonSetting(DefaultSuiteSettings, 'SICKBEARD_LAUNCH')
if not couchpotato_launch:
@ -244,16 +247,17 @@ autoProcessConfig.write()
# launch SABnzbd and get the API key
# ----------------------------------
logging.debug('Launching SABnzbd...')
subprocess.call(sabnzbd,close_fds=True)
logging.debug('...done')
if "true" in sabnzbd_launch:
logging.debug('Launching SABnzbd...')
subprocess.call(sabnzbd,close_fds=True)
logging.debug('...done')
# SABnzbd will only complete the .ini file when we first access the web interface
if firstLaunch:
loadWebInterface('http://' + sabNzbdHost,user,pwd)
sabNzbdConfig.reload()
sabNzbdApiKey = sabNzbdConfig['misc']['api_key']
logging.debug('SABnzbd api key: ' + sabNzbdApiKey)
if firstLaunch:
loadWebInterface('http://' + sabNzbdHost,user,pwd)
sabNzbdConfig.reload()
sabNzbdApiKey = sabNzbdConfig['misc']['api_key']
logging.debug('SABnzbd api key: ' + sabNzbdApiKey)
# write SickBeard settings
# ------------------------
@ -268,11 +272,12 @@ defaultConfig['General']['web_port'] = '8082'
defaultConfig['General']['web_host'] = host
defaultConfig['General']['web_username'] = user
defaultConfig['General']['web_password'] = pwd
defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['SABnzbd']['sab_password'] = pwd
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['SABnzbd']['sab_host'] = 'http://' + sabNzbdHost + '/'
if "true" in sabnzbd_launch:
defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['SABnzbd']['sab_password'] = pwd
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['SABnzbd']['sab_host'] = 'http://' + sabNzbdHost + '/'
defaultConfig['XBMC'] = {}
defaultConfig['XBMC']['use_xbmc'] = '1'
defaultConfig['XBMC']['xbmc_host'] = '127.0.0.1:' + xbmcPort
@ -319,11 +324,12 @@ defaultConfig['global']['password'] = pwd
defaultConfig['global']['username'] = user
defaultConfig['global']['port'] = '8083'
defaultConfig['global']['host'] = host
defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd
defaultConfig['Sabnzbd']['apikey'] = sabNzbdApiKey
defaultConfig['Sabnzbd']['host'] = sabNzbdHost
if "true" in sabnzbd_launch:
defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd
defaultConfig['Sabnzbd']['apikey'] = sabNzbdApiKey
defaultConfig['Sabnzbd']['host'] = sabNzbdHost
defaultConfig['XBMC'] = {}
defaultConfig['XBMC']['enabled'] = 'True'
defaultConfig['XBMC']['host'] = '127.0.0.1:' + xbmcPort
@ -376,11 +382,12 @@ defaultConfig['updater'] = {}
defaultConfig['updater']['enabled'] = '0'
defaultConfig['updater']['notification'] = '0'
defaultConfig['updater']['automatic'] = '0'
defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd
defaultConfig['Sabnzbd']['api_key'] = sabNzbdApiKey
defaultConfig['Sabnzbd']['host'] = sabNzbdHost
if "true" in sabnzbd_launch:
defaultConfig['Sabnzbd'] = {}
defaultConfig['Sabnzbd']['username'] = user
defaultConfig['Sabnzbd']['password'] = pwd
defaultConfig['Sabnzbd']['api_key'] = sabNzbdApiKey
defaultConfig['Sabnzbd']['host'] = sabNzbdHost
defaultConfig['xbmc'] = {}
defaultConfig['xbmc']['enabled'] = '1'
defaultConfig['xbmc']['host'] = '127.0.0.1:' + xbmcPort
@ -418,11 +425,12 @@ defaultConfig['General']['http_port'] = '8084'
defaultConfig['General']['http_host'] = host
defaultConfig['General']['http_username'] = user
defaultConfig['General']['http_password'] = pwd
defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['SABnzbd']['sab_password'] = pwd
if "true" in sabnzbd_launch:
defaultConfig['SABnzbd'] = {}
defaultConfig['SABnzbd']['sab_apikey'] = sabNzbdApiKey
defaultConfig['SABnzbd']['sab_host'] = sabNzbdHost
defaultConfig['SABnzbd']['sab_username'] = user
defaultConfig['SABnzbd']['sab_password'] = pwd
if firstLaunch:
defaultConfig['SABnzbd']['sab_category'] = 'music'

View File

@ -6,6 +6,7 @@
<string id="1010">User Settings</string>
<string id="1022">Username</string>
<string id="1023">Password</string>
<string id="1024">Enable SABnzbd</string>>
<string id="1025">Enable Sickbeard</string>
<string id="1026">Enable Couchpotato</string>
<string id="1027">Couchpotato Version</string>

View File

@ -7,6 +7,7 @@
<setting type="sep" />
<setting id="SABNZBD_USER" type="text" label="1022" default="openelec"/>
<setting id="SABNZBD_PWD" type="text" label="1023" default="openelec"/>
<setting id="SABNZBD_LAUNCH" type="bool" label="1024" default="true" />
<setting id="SICKBEARD_LAUNCH" type="bool" label="1025" default="true" />
<setting id="COUCHPOTATO_LAUNCH" type="bool" label="1026" default="true" />
<setting id="COUCHPOTATO_VERSION" type="enum" label="1027" default="0" values="Version 1|Version 2" enable="eq(-1,true)" />