aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/friends.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/friends.ts')
-rw-r--r--server/lib/friends.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/lib/friends.ts b/server/lib/friends.ts
index 4d56e9eb2..a65820191 100644
--- a/server/lib/friends.ts
+++ b/server/lib/friends.ts
@@ -38,7 +38,9 @@ import {
38 RemoteVideoCreateData, 38 RemoteVideoCreateData,
39 RemoteVideoUpdateData, 39 RemoteVideoUpdateData,
40 RemoteVideoRemoveData, 40 RemoteVideoRemoveData,
41 RemoteVideoReportAbuseData 41 RemoteVideoReportAbuseData,
42 ResultList,
43 Pod as FormatedPod
42} from '../../shared' 44} from '../../shared'
43 45
44type QaduParam = { videoId: string, type: RequestVideoQaduType } 46type QaduParam = { videoId: string, type: RequestVideoQaduType }
@@ -268,8 +270,8 @@ export {
268 270
269function computeForeignPodsList (host: string, podsScore: { [ host: string ]: number }) { 271function computeForeignPodsList (host: string, podsScore: { [ host: string ]: number }) {
270 // TODO: type res 272 // TODO: type res
271 return getForeignPodsList(host).then((res: any) => { 273 return getForeignPodsList(host).then(res => {
272 const foreignPodsList = res.data 274 const foreignPodsList: { host: string }[] = res.data
273 275
274 // Let's give 1 point to the pod we ask the friends list 276 // Let's give 1 point to the pod we ask the friends list
275 foreignPodsList.push({ host }) 277 foreignPodsList.push({ host })
@@ -302,7 +304,7 @@ function computeWinningPods (hosts: string[], podsScore: { [ host: string ]: num
302} 304}
303 305
304function getForeignPodsList (host: string) { 306function getForeignPodsList (host: string) {
305 return new Promise((res, rej) => { 307 return new Promise< ResultList<FormatedPod> >((res, rej) => {
306 const path = '/api/' + API_VERSION + '/pods' 308 const path = '/api/' + API_VERSION + '/pods'
307 309
308 request.get(REMOTE_SCHEME.HTTP + '://' + host + path, function (err, response, body) { 310 request.get(REMOTE_SCHEME.HTTP + '://' + host + path, function (err, response, body) {