WebUI: Always show Auto Torrent Management option

This behavior is consistent with the GUI.

Closes #22702.
PR #22819.
This commit is contained in:
Thomas Piccirello 2025-06-09 06:31:46 -07:00 committed by GitHub
parent 7ed026ef78
commit 06756936f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -331,7 +331,6 @@ window.qBittorrent.ContextMenu ??= (() => {
let there_are_force_start = false;
let all_are_super_seeding = true;
let all_are_auto_tmm = true;
let there_are_auto_tmm = false;
let thereAreV1Hashes = false;
let thereAreV2Hashes = false;
const tagCount = new Map();
@ -366,9 +365,7 @@ window.qBittorrent.ContextMenu ??= (() => {
else
there_are_force_start = true;
if (data["auto_tmm"] === true)
there_are_auto_tmm = true;
else
if (data["auto_tmm"] !== true)
all_are_auto_tmm = false;
if (data["infohash_v1"] !== "")
@ -446,13 +443,7 @@ window.qBittorrent.ContextMenu ??= (() => {
else if (!there_are_stopped && !there_are_force_start)
this.hideItem("start");
if (!all_are_auto_tmm && there_are_auto_tmm) {
this.hideItem("autoTorrentManagement");
}
else {
this.showItem("autoTorrentManagement");
this.setItemChecked("autoTorrentManagement", all_are_auto_tmm);
}
this.setItemChecked("autoTorrentManagement", all_are_auto_tmm);
this.setEnabled("copyInfohash1", thereAreV1Hashes);
this.setEnabled("copyInfohash2", thereAreV2Hashes);