diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-05-13 15:02:51 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-05-13 15:02:51 +0200 |
commit | d6ea0175cbfc9995c3b2ec23866f7abafa9e3904 (patch) | |
tree | 45d0f61c889e29263a1c8c73be24a8f24a790c92 | |
parent | 5109ee61483b46acf7a76be51da7d032afea5b33 (diff) | |
download | PeerTube-d6ea0175cbfc9995c3b2ec23866f7abafa9e3904.tar.gz PeerTube-d6ea0175cbfc9995c3b2ec23866f7abafa9e3904.tar.zst PeerTube-d6ea0175cbfc9995c3b2ec23866f7abafa9e3904.zip |
Fix friends making
-rw-r--r-- | server/lib/friends.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js index f4f2ada87..e052574a5 100644 --- a/server/lib/friends.js +++ b/server/lib/friends.js | |||
@@ -156,10 +156,12 @@ function computeWinningPods (urls, podsScore) { | |||
156 | // Only add a pod if it exists in more than a half base pods | 156 | // Only add a pod if it exists in more than a half base pods |
157 | const podsList = [] | 157 | const podsList = [] |
158 | const baseScore = urls.length / 2 | 158 | const baseScore = urls.length / 2 |
159 | Object.keys(baseScore).forEach(function (pod) { | 159 | Object.keys(podsScore).forEach(function (pod) { |
160 | if (podsScore[pod] > baseScore) podsList.push({ url: pod }) | 160 | if (podsScore[pod] > baseScore) podsList.push({ url: pod }) |
161 | }) | 161 | }) |
162 | 162 | console.log(urls) | |
163 | console.log(podsScore) | ||
164 | console.log(podsList) | ||
163 | return podsList | 165 | return podsList |
164 | } | 166 | } |
165 | 167 | ||