aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-24 19:41:09 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-26 09:11:38 +0200
commit72c7248b6fdcdb2175e726ff51b42e7555f2bd84 (patch)
tree1bfdee99dbe2392cc997edba8e314e2a8a401c72 /server/models/request
parent8113a93a0d9f31aa9e23702bbc31b8a76275ae22 (diff)
downloadPeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.gz
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.zst
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.zip
Add video channels
Diffstat (limited to 'server/models/request')
-rw-r--r--server/models/request/request-video-event.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/models/request/request-video-event.ts b/server/models/request/request-video-event.ts
index 4862a5745..34d5c7162 100644
--- a/server/models/request/request-video-event.ts
+++ b/server/models/request/request-video-event.ts
@@ -85,7 +85,8 @@ listWithLimitAndRandom = function (limitPods: number, limitRequestsPerPod: numbe
85 const Pod = db.Pod 85 const Pod = db.Pod
86 86
87 // We make a join between videos and authors to find the podId of our video event requests 87 // We make a join between videos and authors to find the podId of our video event requests
88 const podJoins = 'INNER JOIN "Videos" ON "Videos"."authorId" = "Authors"."id" ' + 88 const podJoins = 'INNER JOIN "VideoChannels" ON "VideoChannels"."authorId" = "Authors"."id" ' +
89 'INNER JOIN "Videos" ON "Videos"."channelId" = "VideoChannels"."id" ' +
89 'INNER JOIN "RequestVideoEvents" ON "RequestVideoEvents"."videoId" = "Videos"."id"' 90 'INNER JOIN "RequestVideoEvents" ON "RequestVideoEvents"."videoId" = "Videos"."id"'
90 91
91 return Pod.listRandomPodIdsWithRequest(limitPods, 'Authors', podJoins).then(podIds => { 92 return Pod.listRandomPodIdsWithRequest(limitPods, 'Authors', podJoins).then(podIds => {
@@ -161,7 +162,7 @@ function groupAndTruncateRequests (events: RequestVideoEventInstance[], limitReq
161 const eventsGrouped: RequestsVideoEventGrouped = {} 162 const eventsGrouped: RequestsVideoEventGrouped = {}
162 163
163 events.forEach(event => { 164 events.forEach(event => {
164 const pod = event.Video.Author.Pod 165 const pod = event.Video.VideoChannel.Author.Pod
165 166
166 if (!eventsGrouped[pod.id]) eventsGrouped[pod.id] = [] 167 if (!eventsGrouped[pod.id]) eventsGrouped[pod.id] = []
167 168