mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-27 08:19:30 +08:00
Merge pull request #9229 from Piccirello/forceReannounce
Add WebUI Force Reannounce option
This commit is contained in:
commit
8dae7f4a87
@ -795,6 +795,14 @@ void TorrentsController::recheckAction()
|
|||||||
applyToTorrents(hashes, [](BitTorrent::TorrentHandle *torrent) { torrent->forceRecheck(); });
|
applyToTorrents(hashes, [](BitTorrent::TorrentHandle *torrent) { torrent->forceRecheck(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TorrentsController::reannounceAction()
|
||||||
|
{
|
||||||
|
checkParams({"hashes"});
|
||||||
|
|
||||||
|
const QStringList hashes {params()["hashes"].split('|')};
|
||||||
|
applyToTorrents(hashes, [](BitTorrent::TorrentHandle *torrent) { torrent->forceReannounce(); });
|
||||||
|
}
|
||||||
|
|
||||||
void TorrentsController::setCategoryAction()
|
void TorrentsController::setCategoryAction()
|
||||||
{
|
{
|
||||||
checkParams({"hashes", "category"});
|
checkParams({"hashes", "category"});
|
||||||
|
@ -49,6 +49,7 @@ private slots:
|
|||||||
void resumeAction();
|
void resumeAction();
|
||||||
void pauseAction();
|
void pauseAction();
|
||||||
void recheckAction();
|
void recheckAction();
|
||||||
|
void reannounceAction();
|
||||||
void renameAction();
|
void renameAction();
|
||||||
void setCategoryAction();
|
void setCategoryAction();
|
||||||
void createCategoryAction();
|
void createCategoryAction();
|
||||||
|
@ -127,6 +127,7 @@
|
|||||||
<li class="separator"><a href="#SequentialDownload"><img src="theme/checked" alt="QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
<li class="separator"><a href="#SequentialDownload"><img src="theme/checked" alt="QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Download in sequential order)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||||
<li><a href="#FirstLastPiecePrio"><img src="theme/checked" alt="QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
<li><a href="#FirstLastPiecePrio"><img src="theme/checked" alt="QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Download first and last pieces first)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||||
<li class="separator"><a href="#ForceRecheck"><img src="theme/document-edit-verify" alt="QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
<li class="separator"><a href="#ForceRecheck"><img src="theme/document-edit-verify" alt="QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Force recheck)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||||
|
<li><a href="#ForceReannounce"><img src="theme/document-edit-verify" alt="QBT_TR(Force reannounce)QBT_TR[CONTEXT=TransferListWidget]"/> QBT_TR(Force reannounce)QBT_TR[CONTEXT=TransferListWidget]</a></li>
|
||||||
<li id="queueingMenuItems" class="separator">
|
<li id="queueingMenuItems" class="separator">
|
||||||
<a href="#priority" class="arrow-right"><span style="display: inline-block; width:16px"></span> QBT_TR(Priority)QBT_TR[CONTEXT=TransferListWidget]</a>
|
<a href="#priority" class="arrow-right"><span style="display: inline-block; width:16px"></span> QBT_TR(Priority)QBT_TR[CONTEXT=TransferListWidget]</a>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -387,15 +387,27 @@ initializeWindows = function() {
|
|||||||
recheckFN = function() {
|
recheckFN = function() {
|
||||||
var hashes = torrentsTable.selectedRowsIds();
|
var hashes = torrentsTable.selectedRowsIds();
|
||||||
if (hashes.length) {
|
if (hashes.length) {
|
||||||
hashes.each(function(hash, index) {
|
|
||||||
new Request({
|
new Request({
|
||||||
url: 'api/v2/torrents/recheck',
|
url: 'api/v2/torrents/recheck',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
hashes: hash
|
hashes: hashes.join("|"),
|
||||||
|
}
|
||||||
|
}).send();
|
||||||
|
updateMainData();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
reannounceFN = function() {
|
||||||
|
var hashes = torrentsTable.selectedRowsIds();
|
||||||
|
if (hashes.length) {
|
||||||
|
new Request({
|
||||||
|
url: 'api/v2/torrents/reannounce',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
hashes: hashes.join("|"),
|
||||||
}
|
}
|
||||||
}).send();
|
}).send();
|
||||||
});
|
|
||||||
updateMainData();
|
updateMainData();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -78,6 +78,9 @@
|
|||||||
ForceRecheck: function(element, ref) {
|
ForceRecheck: function(element, ref) {
|
||||||
recheckFN();
|
recheckFN();
|
||||||
},
|
},
|
||||||
|
ForceReannounce: function(element, ref) {
|
||||||
|
reannounceFN();
|
||||||
|
},
|
||||||
|
|
||||||
SuperSeeding: function(element, ref) {
|
SuperSeeding: function(element, ref) {
|
||||||
setSuperSeedingFN(!ref.getItemChecked('SuperSeeding'));
|
setSuperSeedingFN(!ref.getItemChecked('SuperSeeding'));
|
||||||
|
Loading…
Reference in New Issue
Block a user