WebUI: Add ability to add/remove tracker from selected torrents

Closes #22618.
PR #22698.
This commit is contained in:
Bark
2025-06-28 09:06:03 +03:00
committed by GitHub
parent e447baa04a
commit 690a139538
3 changed files with 21 additions and 32 deletions

View File

@@ -180,6 +180,11 @@ window.qBittorrent.PropTrackers ??= (() => {
const addTrackerFN = () => {
if (current_hash.length === 0)
return;
const selectedTorrents = torrentsTable.selectedRowsIds();
if (selectedTorrents.length !== 0)
current_hash = selectedTorrents.map(encodeURIComponent).join("|");
new MochaUI.Window({
id: "trackersPage",
icon: "images/qbittorrent-tray.svg",
@@ -229,6 +234,10 @@ window.qBittorrent.PropTrackers ??= (() => {
if (current_hash.length === 0)
return;
const selectedTorrents = torrentsTable.selectedRowsIds();
if (selectedTorrents.length !== 0)
current_hash = selectedTorrents.map(encodeURIComponent).join("|");
fetch("api/v2/torrents/removeTrackers", {
method: "POST",
body: new URLSearchParams({