mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 20:58:07 -06:00
Expose 'DHT bootstrap nodes' setting
This allows user to select DHT bootstrap nodes. Or even use their own bootstrap nodes. PR #19594.
This commit is contained in:
@@ -420,6 +420,8 @@ void AppController::preferencesAction()
|
||||
data[u"peer_turnover_interval"_s] = session->peerTurnoverInterval();
|
||||
// Maximum outstanding requests to a single peer
|
||||
data[u"request_queue_size"_s] = session->requestQueueSize();
|
||||
// DHT bootstrap nodes
|
||||
data[u"dht_bootstrap_nodes"_s] = session->getDHTBootstrapNodes();
|
||||
|
||||
setResult(data);
|
||||
}
|
||||
@@ -1018,6 +1020,9 @@ void AppController::setPreferencesAction()
|
||||
// Maximum outstanding requests to a single peer
|
||||
if (hasKey(u"request_queue_size"_s))
|
||||
session->setRequestQueueSize(it.value().toInt());
|
||||
// DHT bootstrap nodes
|
||||
if (hasKey(u"dht_bootstrap_nodes"_s))
|
||||
session->setDHTBootstrapNodes(it.value().toString());
|
||||
|
||||
// Save preferences
|
||||
pref->apply();
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
#include "base/utils/version.h"
|
||||
#include "api/isessionmanager.h"
|
||||
|
||||
inline const Utils::Version<3, 2> API_VERSION {2, 9, 3};
|
||||
inline const Utils::Version<3, 2> API_VERSION {2, 9, 4};
|
||||
|
||||
class APIController;
|
||||
class AuthController;
|
||||
|
||||
@@ -1420,6 +1420,14 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
||||
<input type="text" id="requestQueueSize" style="width: 15em;" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="dhtBootstrapNodes">QBT_TR(DHT bootstrap nodes:)QBT_TR[CONTEXT=OptionsDialog] <a href="https://www.libtorrent.org/reference-Settings.html#dht_bootstrap_nodes" target="_blank">(?)</a></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="dhtBootstrapNodes" placeholder="QBT_TR(Resets to default if empty)QBT_TR[CONTEXT=OptionsDialog]" style="width: 15em;" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
@@ -2241,6 +2249,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
||||
$('peerTurnoverCutoff').setProperty('value', pref.peer_turnover_cutoff);
|
||||
$('peerTurnoverInterval').setProperty('value', pref.peer_turnover_interval);
|
||||
$('requestQueueSize').setProperty('value', pref.request_queue_size);
|
||||
$('dhtBootstrapNodes').setProperty('value', pref.dht_bootstrap_nodes);
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
@@ -2673,6 +2682,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
|
||||
settings.set('peer_turnover_cutoff', $('peerTurnoverCutoff').getProperty('value'));
|
||||
settings.set('peer_turnover_interval', $('peerTurnoverInterval').getProperty('value'));
|
||||
settings.set('request_queue_size', $('requestQueueSize').getProperty('value'));
|
||||
settings.set('dht_bootstrap_nodes', $('dhtBootstrapNodes').getProperty('value'));
|
||||
|
||||
// Send it to qBT
|
||||
const json_str = JSON.encode(settings);
|
||||
|
||||
Reference in New Issue
Block a user