mirror of https://github.com/evilhero/mylar
FIX: Changed qbitorrent loadaction from radio option to dropdown option
This commit is contained in:
parent
47ea602422
commit
1f895fd32d
|
@ -703,18 +703,20 @@
|
||||||
<input type="text" name="qbittorrent_folder" value="${config['qbittorrent_folder']}" size="30"><br/>
|
<input type="text" name="qbittorrent_folder" value="${config['qbittorrent_folder']}" size="30"><br/>
|
||||||
<small>Folder path where torrents will be assigned to</small>
|
<small>Folder path where torrents will be assigned to</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="row left">
|
<div class="row">
|
||||||
<input type="radio" name="qbittorrent_loadaction" id="qbittorrent_clientdefault" value="0" ${config['qbittorrent_clientdefault']}>Add torrent only
|
<label>Add torrent action:</label>
|
||||||
</div>
|
<select name="qbittorrent_loadaction">
|
||||||
<div class="row left">
|
%for x in ['default', 'force_start', 'pause']:
|
||||||
<input type="radio" name="qbittorrent_loadaction" id="qbittorrent_forcestart" value="1" ${config['qbittorrent_forcestart']}>Add torrent and force start
|
<%
|
||||||
</div>
|
if config['qbittorrent_loadaction'] == x:
|
||||||
<div class="row left">
|
outputselect = 'selected'
|
||||||
<input type="radio" name="qbittorrent_loadaction" id="qbittorrent_addpaused" value="2" ${config['qbittorrent_addpaused']}>Add torrent and pause
|
else:
|
||||||
</div>
|
outputselect = ''
|
||||||
<div class="row checkbox left clearfix">
|
%>
|
||||||
<small>qBittorrent "Add torrent" options</small>
|
<option value=${x} ${outputselect}>${x}</option>
|
||||||
</div>
|
%endfor
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -348,7 +348,7 @@ _CONFIG_DEFINITIONS = OrderedDict({
|
||||||
'QBITTORRENT_PASSWORD': (str, 'qBittorrent', None),
|
'QBITTORRENT_PASSWORD': (str, 'qBittorrent', None),
|
||||||
'QBITTORRENT_LABEL': (str, 'qBittorrent', None),
|
'QBITTORRENT_LABEL': (str, 'qBittorrent', None),
|
||||||
'QBITTORRENT_FOLDER': (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_ENABLE': (bool, 'OPDS', False),
|
||||||
'OPDS_AUTHENTICATION': (bool, 'OPDS', False),
|
'OPDS_AUTHENTICATION': (bool, 'OPDS', False),
|
||||||
|
|
|
@ -111,14 +111,14 @@ class TorrentClient(object):
|
||||||
else:
|
else:
|
||||||
logger.debug('Successfully submitted for add via file. Verifying item is now on client.')
|
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')
|
logger.info('Attempting to force start torrent')
|
||||||
try:
|
try:
|
||||||
startit = self.client.force_start(hash)
|
startit = self.client.force_start(hash)
|
||||||
logger.info('startit returned:' + str(startit))
|
logger.info('startit returned:' + str(startit))
|
||||||
except:
|
except:
|
||||||
logger.warn('Unable to force start torrent - please check your client.')
|
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')
|
logger.info('Attempting to pause torrent after loading')
|
||||||
try:
|
try:
|
||||||
startit = self.client.pause(hash)
|
startit = self.client.pause(hash)
|
||||||
|
|
|
@ -4739,9 +4739,7 @@ class WebInterface(object):
|
||||||
"qbittorrent_password": mylar.CONFIG.QBITTORRENT_PASSWORD,
|
"qbittorrent_password": mylar.CONFIG.QBITTORRENT_PASSWORD,
|
||||||
"qbittorrent_label": mylar.CONFIG.QBITTORRENT_LABEL,
|
"qbittorrent_label": mylar.CONFIG.QBITTORRENT_LABEL,
|
||||||
"qbittorrent_folder": mylar.CONFIG.QBITTORRENT_FOLDER,
|
"qbittorrent_folder": mylar.CONFIG.QBITTORRENT_FOLDER,
|
||||||
"qbittorrent_clientdefault": helpers.radio(mylar.CONFIG.QBITTORRENT_LOADACTION, 0),
|
"qbittorrent_loadaction": mylar.CONFIG.QBITTORRENT_LOADACTION,
|
||||||
"qbittorrent_forcestart": helpers.radio(mylar.CONFIG.QBITTORRENT_LOADACTION, 1),
|
|
||||||
"qbittorrent_addpaused": helpers.radio(mylar.CONFIG.QBITTORRENT_LOADACTION, 2),
|
|
||||||
"blackhole_dir": mylar.CONFIG.BLACKHOLE_DIR,
|
"blackhole_dir": mylar.CONFIG.BLACKHOLE_DIR,
|
||||||
"usenet_retention": mylar.CONFIG.USENET_RETENTION,
|
"usenet_retention": mylar.CONFIG.USENET_RETENTION,
|
||||||
"nzbsu": helpers.checked(mylar.CONFIG.NZBSU),
|
"nzbsu": helpers.checked(mylar.CONFIG.NZBSU),
|
||||||
|
|
Loading…
Reference in New Issue