mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 17:23:07 -07:00
Support removing tracker from all torrents in WebUI/WebAPI
Closes #20661. PR #21056.
This commit is contained in:
parent
d19f7b12d9
commit
d2b2afad23
8 changed files with 132 additions and 8 deletions
|
@ -132,6 +132,7 @@ let deleteTorrentsByTagFN = function() {};
|
|||
let startTorrentsByTrackerFN = function() {};
|
||||
let stopTorrentsByTrackerFN = function() {};
|
||||
let deleteTorrentsByTrackerFN = function() {};
|
||||
let deleteTrackerFN = function() {};
|
||||
let copyNameFN = function() {};
|
||||
let copyInfohashFN = function(policy) {};
|
||||
let copyMagnetLinkFN = function() {};
|
||||
|
@ -1134,6 +1135,33 @@ const initializeWindows = function() {
|
|||
}
|
||||
};
|
||||
|
||||
deleteTrackerFN = function(trackerHash) {
|
||||
const trackerHashInt = Number.parseInt(trackerHash, 10);
|
||||
if ((trackerHashInt === TRACKERS_ALL) || (trackerHashInt === TRACKERS_TRACKERLESS))
|
||||
return;
|
||||
|
||||
const tracker = trackerList.get(trackerHashInt);
|
||||
const host = tracker.host;
|
||||
const urls = [...tracker.trackerTorrentMap.keys()];
|
||||
|
||||
new MochaUI.Window({
|
||||
id: "confirmDeletionPage",
|
||||
title: "QBT_TR(Remove tracker)QBT_TR[CONTEXT=confirmDeletionDlg]",
|
||||
loadMethod: "iframe",
|
||||
contentURL: new URI("confirmtrackerdeletion.html").setData("host", host).setData("urls", urls.map(encodeURIComponent).join("|")).toString(),
|
||||
scrollbars: false,
|
||||
resizable: true,
|
||||
maximizable: false,
|
||||
padding: 10,
|
||||
width: 424,
|
||||
height: 100,
|
||||
onCloseComplete: function() {
|
||||
updateMainData();
|
||||
setTrackerFilter(TRACKERS_ALL);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
copyNameFN = function() {
|
||||
const selectedRows = torrentsTable.selectedRowsIds();
|
||||
const names = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue