Allow setting the number of maximum active checking torrents

This is to allow re-checking of multiple torrents simultaneously. This will benefit users who
have multiple disks or SSD.
Closes #15296.

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
This commit is contained in:
An0n
2022-02-27 20:08:10 +06:00
committed by Chocobo1
parent 889d994dbc
commit 801cfdbc24
7 changed files with 75 additions and 1 deletions

View File

@@ -210,6 +210,8 @@ void AppController::preferencesAction()
data["lsd"] = session->isLSDEnabled();
data["encryption"] = session->encryption();
data["anonymous_mode"] = session->isAnonymousModeEnabled();
// Max active checking torrents
data["max_active_checking_torrents"] = session->maxActiveCheckingTorrents();
// Torrent Queueing
data["queueing_enabled"] = session->isQueueingSystemEnabled();
data["max_active_downloads"] = session->maxActiveDownloads();
@@ -584,6 +586,9 @@ void AppController::setPreferencesAction()
session->setEncryption(it.value().toInt());
if (hasKey("anonymous_mode"))
session->setAnonymousModeEnabled(it.value().toBool());
// Max active checking torrents
if (hasKey("max_active_checking_torrents"))
session->setMaxActiveCheckingTorrents(it.value().toInt());
// Torrent Queueing
if (hasKey("queueing_enabled"))
session->setQueueingSystemEnabled(it.value().toBool());

View File

@@ -44,7 +44,7 @@
#include "base/utils/net.h"
#include "base/utils/version.h"
inline const Utils::Version<int, 3, 2> API_VERSION {2, 8, 8};
inline const Utils::Version<int, 3, 2> API_VERSION {2, 8, 9};
class APIController;
class WebApplication;

View File

@@ -472,6 +472,11 @@
</div>
</fieldset>
<div class="formRow">
<label for="maxActiveCheckingTorrents">QBT_TR(Max active checking torrents:)QBT_TR[CONTEXT=OptionsDialog]</label>
<input type="number" id="maxActiveCheckingTorrents" style="width: 4em;" min="-1" />
</div>
<fieldset class="settings">
<legend>
<input type="checkbox" id="queueing_checkbox" onclick="qBittorrent.Preferences.updateQueueingSystem();" />
@@ -1835,6 +1840,8 @@
$('encryption_select').getChildren('option')[encryption].setAttribute('selected', '');
$('anonymous_mode_checkbox').setProperty('checked', pref.anonymous_mode);
$('maxActiveCheckingTorrents').setProperty('value', pref.max_active_checking_torrents);
// Torrent Queueing
$('queueing_checkbox').setProperty('checked', pref.queueing_enabled);
$('max_active_dl_value').setProperty('value', pref.max_active_downloads.toInt());
@@ -2184,6 +2191,8 @@
settings.set('encryption', $('encryption_select').getSelected()[0].getProperty('value'));
settings.set('anonymous_mode', $('anonymous_mode_checkbox').getProperty('checked'));
settings.set('max_active_checking_torrents', $('maxActiveCheckingTorrents').getProperty('value'));
// Torrent Queueing
settings.set('queueing_enabled', $('queueing_checkbox').getProperty('checked'));
if ($('queueing_checkbox').getProperty('checked')) {