WebUI: Improve accuracy of trackers list

This PR fixes various accounting issues with the trackers list. Removing a torrent would not update the trackers list, nor would removing a tracker from a torrent. And removing a tracker with a shared host but unique url (e.g. example.com/1 and example.com/2) would erroneously remove the tracker's host from the list.

Closes #20053.
Closes #20054.
PR  #20601.
This commit is contained in:
Thomas Piccirello 2024-03-29 00:43:49 -07:00 committed by GitHub
parent eb9e98a4b3
commit 4967f977c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 65 additions and 37 deletions

View file

@ -1435,8 +1435,17 @@ window.qBittorrent.DynamicTable = (function() {
break;
default: {
const tracker = trackerList.get(trackerHashInt);
if (tracker && !tracker.torrents.includes(row['full_data'].rowId))
return false;
if (tracker) {
let found = false;
for (const torrents of tracker.trackerTorrentMap.values()) {
if (torrents.includes(row['full_data'].rowId)) {
found = true;
break;
}
}
if (!found)
return false;
}
break;
}
}