SABnzbd: add mor default options, remove unneeded patches, add patch to hide default options

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-04-22 16:05:30 +02:00
parent 1c8c30cafc
commit 3490770910
4 changed files with 253 additions and 106 deletions

View File

@ -1,33 +0,0 @@
diff -Naur SABnzbd-0.6.0RC2/sabnzbd/constants.py SABnzbd-0.6.0RC2.patch/sabnzbd/constants.py
--- SABnzbd-0.6.0RC2/sabnzbd/constants.py 2011-04-10 16:06:27.000000000 +0200
+++ SABnzbd-0.6.0RC2.patch/sabnzbd/constants.py 2011-04-16 21:49:52.858788377 +0200
@@ -70,8 +70,8 @@
DB_HISTORY_NAME = 'history%s.db' % DB_HISTORY_VERSION
DB_QUEUE_NAME = 'queue%s.db' % DB_QUEUE_VERSION
-DEF_DOWNLOAD_DIR = 'Downloads/incomplete'
-DEF_COMPLETE_DIR = 'Downloads/complete'
+DEF_DOWNLOAD_DIR = '/storage/downloads/incoming/'
+DEF_COMPLETE_DIR = '/storage/downloads/'
DEF_CACHE_DIR = 'cache'
DEF_ADMIN_DIR = 'admin'
DEF_LOG_DIR = 'logs'
@@ -83,12 +83,12 @@
DEF_STDINTF = 'smpl'
DEF_SKIN_COLORS = {'smpl':'white', 'classic':'darkblue', 'mobile':'light', 'plush' : 'gold'}
DEF_MAIN_TMPL = 'templates/main.tmpl'
-DEF_INI_FILE = 'sabnzbd.ini'
-DEF_HOST = 'localhost'
-DEF_PORT_WIN = 8080
-DEF_PORT_UNIX = 8080
-DEF_PORT_WIN_SSL = 9090
-DEF_PORT_UNIX_SSL= 9090
+DEF_INI_FILE = 'sabnzbd.conf'
+DEF_HOST = '0.0.0.0'
+DEF_PORT_WIN = 8081
+DEF_PORT_UNIX = 8081
+DEF_PORT_WIN_SSL = 9081
+DEF_PORT_UNIX_SSL= 9081
DEF_WORKDIR = 'sabnzbd'
DEF_LOG_FILE = 'sabnzbd.log'
DEF_LOG_ERRFILE = 'sabnzbd.error.log'

View File

@ -0,0 +1,214 @@
diff -Naur SABnzbd-0.6.0RC2/interfaces/Plush/templates/config_directories.tmpl SABnzbd-0.6.0RC2.patch/interfaces/Plush/templates/config_directories.tmpl
--- SABnzbd-0.6.0RC2/interfaces/Plush/templates/config_directories.tmpl 2011-04-10 16:06:26.000000000 +0200
+++ SABnzbd-0.6.0RC2.patch/interfaces/Plush/templates/config_directories.tmpl 2011-04-22 15:08:09.323174151 +0200
@@ -109,49 +109,6 @@
</fieldset>
</div><!-- /component-group1 -->
- <div id="core-component-group2" class="component-group clearfix">
- <div class="component-group-desc">
- <h3>$T('systemFolders')</h3>
- <p><small>$T('base-folder'):<br/>$my_lcldata</small></p>
- </div>
- <fieldset class="component-group-list">
- <div class="field-pair">
- <label class="nocheck clearfix" for="admin_dir">
- <span class="component-title">$T('opt-admin_dir')</span>
- <input type="text" size="50" name="admin_dir" id="admin_dir" value="$admin_dir">
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-admin_dir1')</span>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-admin_dir2')</span>
- </label>
- </div>
- <div class="field-pair alt">
- <label class="nocheck clearfix" for="log_dir">
- <span class="component-title">$T('opt-log_dir')</span>
- <input type="text" size="50" name="log_dir" id="log_dir" value="$log_dir">
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-log_dir')</span>
- </label>
- </div>
- <div class="field-pair">
- <label class="nocheck clearfix" for="nzb_backup_dir">
- <span class="component-title">$T('opt-nzb_backup_dir')</span>
- <input type="text" size="50" name="nzb_backup_dir" id="nzb_backup_dir" value="$nzb_backup_dir">
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-nzb_backup_dir')</span>
- </label>
- </div>
- </fieldset>
- </div><!-- /component-group2 -->
-
<div class="component-group-last clearfix">
<div class="component-group-desc">
<h3>&nbsp;</h3>
diff -Naur SABnzbd-0.6.0RC2/interfaces/Plush/templates/config_general.tmpl SABnzbd-0.6.0RC2.patch/interfaces/Plush/templates/config_general.tmpl
--- SABnzbd-0.6.0RC2/interfaces/Plush/templates/config_general.tmpl 2011-04-10 16:06:26.000000000 +0200
+++ SABnzbd-0.6.0RC2.patch/interfaces/Plush/templates/config_general.tmpl 2011-04-22 14:59:06.304131312 +0200
@@ -14,82 +14,6 @@
</div>
<fieldset class="component-group-list">
<div class="field-pair">
- <label class="nocheck clearfix" for="host">
- <span class="component-title">$T('opt-host')</span>
- <input type="text" name="host" id="host" value="$host"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-host')</span>
- </label>
- </div>
- <div class="field-pair alt">
- <label class="nocheck clearfix" for="port">
- <span class="component-title">$T('opt-port')</span>
- <input type="text" name="port" id="port" size=8 value="$port"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-port')</span>
- </label>
- </div>
- <div class="field-pair">
- <label class="nocheck clearfix" for="username">
- <span class="component-title">$T('opt-web_username')</span>
- <input type="text" name="username" id="username" value="$username"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-web_username')</span>
- </label>
- </div>
- <div class="field-pair alt">
- <label class="nocheck clearfix" for="password">
- <span class="component-title">$T('opt-web_password')</span>
- <input type="password" name="password" id="password" value="$password"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-web_password')</span>
- </label>
- </div>
- <div class="field-pair">
- <label class="nocheck clearfix" for="web_dir">
- <span class="component-title">$T('opt-web_dir')</span>
- <select name="web_dir" id="web_dir">
- <!--#for $webline in $web_list#-->
- <!--#if $webline.lower() == $web_dir.lower()#-->
- <option value="$webline" selected>$webline</option>
- <!--#else#-->
- <option value="$webline">$webline</option>
- <!--#end if#-->
- <!--#end for#-->
- </select>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-web_dir')</span>
- </label>
- </div>
- <div class="field-pair alt">
- <label class="nocheck clearfix" for="web_dir2">
- <span class="component-title">$T('opt-web_dir2')</span>
- <select name="web_dir2" id="web_dir2">
- <!--#for $webline in $web_list2#-->
- <!--#if $webline.lower() == $web_dir2.lower()#-->
- <option value="$webline" selected>$webline</option>
- <!--#else#-->
- <option value="$webline">$webline</option>
- <!--#end if#-->
- <!--#end for#-->
- </select>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-web_dir2')</span>
- </label>
- </div>
- <div class="field-pair">
<label class="nocheck clearfix" for="language">
<span class="component-title">$T('opt-language')</span>
<select name="language" id="language" id="language" class="select">
@@ -129,13 +53,6 @@
<span class="component-desc">$T('explain-nzbkey')</span>
</label>
</div>
- <div class="field-pair alt">
- <label class="clearfix" for="disable_api_key">
- <input type="checkbox" name="disable_api_key" id="disable_api_key" value="1" <!--#if $disable_api_key > 0 then 'checked="1"' else ""#--> />
- <span class="component-title">$T('opt-disableApikey')</span>
- <span class="component-desc">$T('explain-disableApikey')</span>
- </label>
- </div>
</fieldset>
</div><!-- /component-group1 -->
@@ -152,36 +69,6 @@
<span class="component-desc">$T('explain-enable_https')</span>
</label>
</div>
- <div class="field-pair alt">
- <label class="nocheck clearfix" for="https_port">
- <span class="component-title">$T('opt-https_port')</span>
- <input type="text" name="https_port" id="https_port" size="8" value="$https_port"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-https_port')</span>
- </label>
- </div>
- <div class="field-pair">
- <label class="nocheck clearfix" for="https_cert">
- <span class="component-title">$T('opt-https_cert')</span>
- <input type="text" name="https_cert" id="https_cert" value="$https_cert"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-https_cert')</span>
- </label>
- </div>
- <div class="field-pair alt">
- <label class="nocheck clearfix" for="https_key">
- <span class="component-title">$T('opt-https_key')</span>
- <input type="text" name="https_key" id="https_key" value="$https_key"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-https_key')</span>
- </label>
- </div>
</fieldset>
</div><!-- /component-group2 -->
diff -Naur SABnzbd-0.6.0RC2/interfaces/Plush/templates/config_switches.tmpl SABnzbd-0.6.0RC2.patch/interfaces/Plush/templates/config_switches.tmpl
--- SABnzbd-0.6.0RC2/interfaces/Plush/templates/config_switches.tmpl 2011-04-10 16:06:26.000000000 +0200
+++ SABnzbd-0.6.0RC2.patch/interfaces/Plush/templates/config_switches.tmpl 2011-04-22 15:21:32.791455752 +0200
@@ -12,20 +12,6 @@
<h3>$T('swtag-general')</h3>
</div>
<fieldset class="component-group-list">
- <div class="field-pair">
- <input type="checkbox" name="check_new_rel" id="check_new_rel" value="1" <!--#if $check_new_rel > 0 then "checked=1" else ""#--> />
- <label class="clearfix" for="check_new_rel">
- <span class="component-title">$T('opt-check_new_rel')</span>
- <span class="component-desc">$T('explain-check_new_rel')</span>
- </label>
- </div>
- <div class="field-pair alt">
- <input type="checkbox" name="auto_browser" id="auto_browser" value="1" <!--#if $auto_browser > 0 then "checked=1" else ""#--> />
- <label class="clearfix" for="auto_browser">
- <span class="component-title">$T('opt-auto_browser')</span>
- <span class="component-desc">$T('explain-auto_browser')</span>
- </label>
- </div>
<!--#if $have_ampm#-->
<div class="field-pair">
<input type="checkbox" name="ampm" id="ampm" value="1" <!--#if $ampm > 0 then "checked=1" else ""#--> />

View File

@ -1,70 +0,0 @@
diff -Naur SABnzbd-0.6.0RC2/interfaces/Classic/templates/config_general.tmpl SABnzbd-0.6.0RC2.patch/interfaces/Classic/templates/config_general.tmpl
--- SABnzbd-0.6.0RC2/interfaces/Classic/templates/config_general.tmpl 2011-04-16 23:15:34.940298239 +0200
+++ SABnzbd-0.6.0RC2.patch/interfaces/Classic/templates/config_general.tmpl 2011-04-16 23:21:11.140812740 +0200
@@ -13,16 +13,6 @@
<legend>$T('webServer')</legend>
<i>$T('restartRequired')</i><br/><br/>
-<strong>$T('opt-host'):</strong><br>
-$T('explain-host')<br>
-<input type="text" name="host" value="$host">
-<br>
-<br>
-<strong>$T('opt-port'):</strong><br>
-$T('explain-port')<br>
-<input type="text" name="port" value="$port">
-<br>
-<br>
<strong>$T('opt-web_dir'):</strong><br>
$T('explain-web_dir')<br>
<select name="web_dir">
diff -Naur SABnzbd-0.6.0RC2/interfaces/Plush/templates/config_general.tmpl SABnzbd-0.6.0RC2.patch/interfaces/Plush/templates/config_general.tmpl
--- SABnzbd-0.6.0RC2/interfaces/Plush/templates/config_general.tmpl 2011-04-16 23:15:34.954297968 +0200
+++ SABnzbd-0.6.0RC2.patch/interfaces/Plush/templates/config_general.tmpl 2011-04-16 23:23:32.496084161 +0200
@@ -14,26 +14,6 @@
</div>
<fieldset class="component-group-list">
<div class="field-pair">
- <label class="nocheck clearfix" for="host">
- <span class="component-title">$T('opt-host')</span>
- <input type="text" name="host" id="host" value="$host"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-host')</span>
- </label>
- </div>
- <div class="field-pair alt">
- <label class="nocheck clearfix" for="port">
- <span class="component-title">$T('opt-port')</span>
- <input type="text" name="port" id="port" size=8 value="$port"/>
- </label>
- <label class="nocheck clearfix">
- <span class="component-title">&nbsp;</span>
- <span class="component-desc">$T('explain-port')</span>
- </label>
- </div>
- <div class="field-pair">
<label class="nocheck clearfix" for="username">
<span class="component-title">$T('opt-web_username')</span>
<input type="text" name="username" id="username" value="$username"/>
diff -Naur SABnzbd-0.6.0RC2/interfaces/smpl/templates/config_general.tmpl SABnzbd-0.6.0RC2.patch/interfaces/smpl/templates/config_general.tmpl
--- SABnzbd-0.6.0RC2/interfaces/smpl/templates/config_general.tmpl 2011-04-16 23:15:34.944298160 +0200
+++ SABnzbd-0.6.0RC2.patch/interfaces/smpl/templates/config_general.tmpl 2011-04-16 23:22:14.877582554 +0200
@@ -5,16 +5,6 @@
<fieldset class="EntryFieldSet">
<legend>$T('webServer') <i>($T('restartRequired'))</i></legend>
<hr />
- <label for "host" class="label">$T('opt-host'):</label>
- <input type="text" name="host" value="$host">
- <span class="tips">$T('explain-host')</span>
- <br class="clear" />
-
- <label for "port" class="label">$T('opt-port'):</label>
- <input type="text" name="port" value="$port">
- <span class="tips">$T('explain-port')</span>
- <br class="clear" />
-
<label for "userinterface" class="label">$T('opt-web_dir'):</label>
<select name="web_dir" id="webdir" class="select">

View File

@ -27,13 +27,27 @@ SABNZBD_HOME="$HOME/.xbmc/userdata/addon_data/addon.downloadmanager.SABnzbd"
SABNZBD_SETTINGS="$SABNZBD_HOME/settings.xml"
SABNZBD_DISABLEAPIKEY="0"
SABNZBD_CHECKRELEASE="0"
SABNZBD_LAUNCHBROWSER="0"
SABNZBD_HTTPPORT="8081"
SABNZBD_HTTPSPORT="9081"
SABNZBD_HTTPSCERT="server.cert"
SABNZBD_HTTPSKEY="server.key"
SABNZBD_SKIN="Plush"
SABNZBD_SKIN2="Plush"
SABNZBD_WEBCOLOR="gold"
SABNZBD_WEBCOLOR2="gold"
SABNZBD_LOGDIR="logs"
SABNZBD_ADMINDIR="admin"
SABNZBD_BACKUPDIR="backup"
SABNZBD_INCOMPLETEDIR="/storage/downloads/incomplete"
SABNZBD_COMPLETEDIR="/storage/downloads"
SABNZBD_WATCHDIR="/storage/downloads/watch"
write_ini() {
python bin/ini_tool --action=write \
--file=$SABNZBD_HOME/sabnzbd.ini \
@ -48,9 +62,9 @@ if [ ! -f "$SABNZBD_SETTINGS" ]; then
cp settings-default.xml $SABNZBD_SETTINGS
fi
mkdir -p /storage/downloads
mkdir -p /storage/downloads/incoming
mkdir -p /storage/downloads/watch
if [ ! -f "$SABNZBD_HOME/sabnzbd.ini" ]; then
SABNZBD_FIRSTRUN="yes"
fi
# use settings from xbmc setup dialog
SABNZBD_USER=`grep SABNZBD_USER $SABNZBD_SETTINGS | awk '{print $3 }' | sed -e "s,value=,," -e "s,\",,g"`
@ -62,14 +76,36 @@ if [ -z "$SABNZBD_IP" ]; then
fi
write_ini misc disable_api_key $SABNZBD_DISABLEAPIKEY
write_ini misc check_new_rel $SABNZBD_CHECKRELEASE
write_ini misc auto_browser $SABNZBD_LAUNCHBROWSER
write_ini misc username $SABNZBD_USER
write_ini misc password $SABNZBD_PWD
write_ini misc port $SABNZBD_HTTPPORT
write_ini misc https_port $SABNZBD_HTTPSPORT
write_ini misc https_cert $SABNZBD_HTTPSCERT
write_ini misc https_key $SABNZBD_HTTPSKEY
write_ini misc host $SABNZBD_IP
write_ini misc web_dir $SABNZBD_SKIN
write_ini misc web_dir2 $SABNZBD_SKIN2
write_ini misc web_color $SABNZBD_WEBCOLOR
write_ini misc web_color2 $SABNZBD_WEBCOLOR2
write_ini misc log_dir $SABNZBD_LOGDIR
write_ini misc admin_dir $SABNZBD_ADMINDIR
write_ini misc nzb_backup_dir $SABNZBD_BACKUPDIR
if [ "$SABNZBD_FIRSTRUN" = "yes" ]; then
mkdir -p "$SABNZBD_INCOMPLETEDIR"
mkdir -p "$SABNZBD_COMPLETEDIR"
mkdir -p "$SABNZBD_WATCHDIR"
write_ini misc download_dir $SABNZBD_INCOMPLETEDIR
write_ini misc complete_dir $SABNZBD_COMPLETEDIR
write_ini misc dirscan_dir $SABNZBD_WATCHDIR
write_ini servers:localhost name "localhost"
write_ini servers:localhost host "localhost"
write_ini servers:localhost port "119"
write_ini servers:localhost enable "0"
fi
python ./SABnzbd/SABnzbd.py -d -f $SABNZBD_HOME/sabnzbd.ini -l 0 > /dev/null 2>&1