Browse Source

WebUI: group trackers by hostname (#15264)

Closes #13608.
adaptive-webui-19844
Mengyang Li 3 years ago committed by GitHub
parent
commit
4ac25a50ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/webui/www/private/scripts/client.js

9
src/webui/www/private/scripts/client.js

@ -96,6 +96,10 @@ function genHash(string) { @@ -96,6 +96,10 @@ function genHash(string) {
return hash;
}
function getTrackerHost(url) {
return new URL(url).hostname;
}
function getSyncMainDataInterval() {
return customSyncMainDataInterval ? customSyncMainDataInterval : serverSyncMainDataInterval;
}
@ -622,9 +626,10 @@ window.addEvent('load', function() { @@ -622,9 +626,10 @@ window.addEvent('load', function() {
if (response['trackers']) {
for (const tracker in response['trackers']) {
const torrents = response['trackers'][tracker];
const hash = genHash(tracker);
const host = getTrackerHost(tracker);
const hash = genHash(host);
trackerList.set(hash, {
url: tracker,
url: host,
torrents: torrents
});
}

Loading…
Cancel
Save