From 573dc9777d987fb78d2b49972a4f98914cc1f047 Mon Sep 17 00:00:00 2001 From: Jesse Chan Date: Sat, 5 Sep 2020 21:16:02 +0800 Subject: [PATCH] torrentListPropMap: deduplicate trackerDomains Occasionally one torrent might have multiple tracker URLs from the same domain. For instance, when there is separate ipv6 tracker URL or when user use the "Set Tracker" feature. Duplicate trackerDomains are not useful. It only causes the count to be incremented multiple times and displayed incorrectly. --- server/constants/torrentListPropMap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/constants/torrentListPropMap.js b/server/constants/torrentListPropMap.js index e2e53e63..397d7d97 100644 --- a/server/constants/torrentListPropMap.js +++ b/server/constants/torrentListPropMap.js @@ -219,7 +219,8 @@ torrentListPropMap.set('trackerURIs', { } }); - return trackerDomains; + // Deduplicate + return [...new Set(trackerDomains)]; }, });