FIX: Changed qbitorrent loadaction from radio option to dropdown option

This commit is contained in:
evilhero 2019-02-12 10:41:35 -05:00
parent 47ea602422
commit 1f895fd32d
4 changed files with 18 additions and 18 deletions

View File

@ -703,18 +703,20 @@
<input type="text" name="qbittorrent_folder" value="${config['qbittorrent_folder']}" size="30"><br/>
<small>Folder path where torrents will be assigned to</small>
</div>
<div class="row left">
<input type="radio" name="qbittorrent_loadaction" id="qbittorrent_clientdefault" value="0" ${config['qbittorrent_clientdefault']}>Add torrent only
</div>
<div class="row left">
<input type="radio" name="qbittorrent_loadaction" id="qbittorrent_forcestart" value="1" ${config['qbittorrent_forcestart']}>Add torrent and force start
</div>
<div class="row left">
<input type="radio" name="qbittorrent_loadaction" id="qbittorrent_addpaused" value="2" ${config['qbittorrent_addpaused']}>Add torrent and pause
</div>
<div class="row checkbox left clearfix">
<small>qBittorrent "Add torrent" options</small>
</div>
<div class="row">
<label>Add torrent action:</label>
<select name="qbittorrent_loadaction">
%for x in ['default', 'force_start', 'pause']:
<%
if config['qbittorrent_loadaction'] == x:
outputselect = 'selected'
else:
outputselect = ''
%>
<option value=${x} ${outputselect}>${x}</option>
%endfor
</select>
</div>
</fieldset>
</div>
</td>

View File

@ -348,7 +348,7 @@ _CONFIG_DEFINITIONS = OrderedDict({
'QBITTORRENT_PASSWORD': (str, 'qBittorrent', None),
'QBITTORRENT_LABEL': (str, 'qBittorrent', None),
'QBITTORRENT_FOLDER': (str, 'qBittorrent', None),
'QBITTORRENT_LOADACTION': (int, 'qBittorrent', 0), #0': client default, #1': force start, #2': add paused
'QBITTORRENT_LOADACTION': (str, 'qBittorrent', 'default'), #default, force_start, paused
'OPDS_ENABLE': (bool, 'OPDS', False),
'OPDS_AUTHENTICATION': (bool, 'OPDS', False),

View File

@ -111,14 +111,14 @@ class TorrentClient(object):
else:
logger.debug('Successfully submitted for add via file. Verifying item is now on client.')
if mylar.CONFIG.QBITTORRENT_LOADACTION == 1:
if mylar.CONFIG.QBITTORRENT_LOADACTION == 'force_start':
logger.info('Attempting to force start torrent')
try:
startit = self.client.force_start(hash)
logger.info('startit returned:' + str(startit))
except:
logger.warn('Unable to force start torrent - please check your client.')
elif mylar.CONFIG.QBITTORRENT_LOADACTION == 2:
elif mylar.CONFIG.QBITTORRENT_LOADACTION == 'pause':
logger.info('Attempting to pause torrent after loading')
try:
startit = self.client.pause(hash)

View File

@ -4739,9 +4739,7 @@ class WebInterface(object):
"qbittorrent_password": mylar.CONFIG.QBITTORRENT_PASSWORD,
"qbittorrent_label": mylar.CONFIG.QBITTORRENT_LABEL,
"qbittorrent_folder": mylar.CONFIG.QBITTORRENT_FOLDER,
"qbittorrent_clientdefault": helpers.radio(mylar.CONFIG.QBITTORRENT_LOADACTION, 0),
"qbittorrent_forcestart": helpers.radio(mylar.CONFIG.QBITTORRENT_LOADACTION, 1),
"qbittorrent_addpaused": helpers.radio(mylar.CONFIG.QBITTORRENT_LOADACTION, 2),
"qbittorrent_loadaction": mylar.CONFIG.QBITTORRENT_LOADACTION,
"blackhole_dir": mylar.CONFIG.BLACKHOLE_DIR,
"usenet_retention": mylar.CONFIG.USENET_RETENTION,
"nzbsu": helpers.checked(mylar.CONFIG.NZBSU),