aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/request
diff options
context:
space:
mode:
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