From: Chocobozzz Date: Thu, 26 Oct 2017 09:42:36 +0000 (+0200) Subject: Fix join in video events X-Git-Tag: v0.0.1-alpha~264 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b869d19068f42eb2b7bc33e1e2bff10bd07f3fda;p=oweals%2Fpeertube.git Fix join in video events --- diff --git a/server/models/request/request-video-event.ts b/server/models/request/request-video-event.ts index 34d5c7162..d7dce9bc8 100644 --- a/server/models/request/request-video-event.ts +++ b/server/models/request/request-video-event.ts @@ -102,15 +102,20 @@ listWithLimitAndRandom = function (limitPods: number, limitRequestsPerPod: numbe model: RequestVideoEvent['sequelize'].models.Video, include: [ { - model: RequestVideoEvent['sequelize'].models.Author, + model: RequestVideoEvent['sequelize'].models.VideoChannel, include: [ { - model: RequestVideoEvent['sequelize'].models.Pod, - where: { - id: { - $in: podIds + model: RequestVideoEvent['sequelize'].models.Author, + include: [ + { + model: RequestVideoEvent['sequelize'].models.Pod, + where: { + id: { + $in: podIds + } + } } - } + ] } ] } @@ -138,10 +143,15 @@ removeByRequestIdsAndPod = function (ids: number[], podId: number) { model: RequestVideoEvent['sequelize'].models.Video, include: [ { - model: RequestVideoEvent['sequelize'].models.Author, - where: { - podId - } + model: RequestVideoEvent['sequelize'].models.VideoChannel, + include: [ + { + model: RequestVideoEvent['sequelize'].models.Author, + where: { + podId + } + } + ] } ] }