mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 17:23:07 -07:00
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:
parent
eb9e98a4b3
commit
4967f977c5
3 changed files with 65 additions and 37 deletions
|
@ -874,9 +874,16 @@ const initializeWindows = function() {
|
|||
case TRACKERS_TRACKERLESS:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes('all', CATEGORIES_ALL, TAGS_ALL, TRACKERS_TRACKERLESS);
|
||||
break;
|
||||
default:
|
||||
hashes = trackerList.get(trackerHashInt).torrents;
|
||||
default: {
|
||||
const uniqueTorrents = new Set();
|
||||
for (const torrents of trackerList.get(trackerHashInt).trackerTorrentMap.values()) {
|
||||
for (const torrent of torrents) {
|
||||
uniqueTorrents.add(torrent);
|
||||
}
|
||||
}
|
||||
hashes = [...uniqueTorrents];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hashes.length > 0) {
|
||||
|
@ -901,9 +908,16 @@ const initializeWindows = function() {
|
|||
case TRACKERS_TRACKERLESS:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes('all', CATEGORIES_ALL, TAGS_ALL, TRACKERS_TRACKERLESS);
|
||||
break;
|
||||
default:
|
||||
hashes = trackerList.get(trackerHashInt).torrents;
|
||||
default: {
|
||||
const uniqueTorrents = new Set();
|
||||
for (const torrents of trackerList.get(trackerHashInt).trackerTorrentMap.values()) {
|
||||
for (const torrent of torrents) {
|
||||
uniqueTorrents.add(torrent);
|
||||
}
|
||||
}
|
||||
hashes = [...uniqueTorrents];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hashes.length) {
|
||||
|
@ -928,9 +942,16 @@ const initializeWindows = function() {
|
|||
case TRACKERS_TRACKERLESS:
|
||||
hashes = torrentsTable.getFilteredTorrentsHashes('all', CATEGORIES_ALL, TAGS_ALL, TRACKERS_TRACKERLESS);
|
||||
break;
|
||||
default:
|
||||
hashes = trackerList.get(trackerHashInt).torrents;
|
||||
default: {
|
||||
const uniqueTorrents = new Set();
|
||||
for (const torrents of trackerList.get(trackerHashInt).trackerTorrentMap.values()) {
|
||||
for (const torrent of torrents) {
|
||||
uniqueTorrents.add(torrent);
|
||||
}
|
||||
}
|
||||
hashes = [...uniqueTorrents];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hashes.length) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue