aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-query-builder.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-06-09 15:59:35 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-06-10 14:02:41 +0200
commitf046e2fa5c2af98f378056206ef65347f4b29b8d (patch)
treec2cffab0541c9fb0c29e02c7011fe74e108274d3 /server/models/video/video-query-builder.ts
parent5fb2e2888ce032c638e4b75d07458642f0833e52 (diff)
downloadPeerTube-f046e2fa5c2af98f378056206ef65347f4b29b8d.tar.gz
PeerTube-f046e2fa5c2af98f378056206ef65347f4b29b8d.tar.zst
PeerTube-f046e2fa5c2af98f378056206ef65347f4b29b8d.zip
Fix video follow SQL
Diffstat (limited to 'server/models/video/video-query-builder.ts')
-rw-r--r--server/models/video/video-query-builder.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/models/video/video-query-builder.ts b/server/models/video/video-query-builder.ts
index 455f9f30f..6211c9e56 100644
--- a/server/models/video/video-query-builder.ts
+++ b/server/models/video/video-query-builder.ts
@@ -135,12 +135,14 @@ function buildListQuery (model: typeof Model, options: BuildVideosQueryOptions)
135 ' EXISTS (' + 135 ' EXISTS (' +
136 ' SELECT 1 FROM "videoShare" ' + 136 ' SELECT 1 FROM "videoShare" ' +
137 ' INNER JOIN "actorFollow" "actorFollowShare" ON "actorFollowShare"."targetActorId" = "videoShare"."actorId" ' + 137 ' INNER JOIN "actorFollow" "actorFollowShare" ON "actorFollowShare"."targetActorId" = "videoShare"."actorId" ' +
138 ' AND "actorFollowShare"."actorId" = :followerActorId WHERE "videoShare"."videoId" = "video"."id"' + 138 ' AND "actorFollowShare"."actorId" = :followerActorId AND "actorFollowShare"."state" = \'accepted\' ' +
139 ' WHERE "videoShare"."videoId" = "video"."id"' +
139 ' )' + 140 ' )' +
140 ' OR' + 141 ' OR' +
141 ' EXISTS (' + 142 ' EXISTS (' +
142 ' SELECT 1 from "actorFollow" ' + 143 ' SELECT 1 from "actorFollow" ' +
143 ' WHERE "actorFollow"."targetActorId" = "videoChannel"."actorId" AND "actorFollow"."actorId" = :followerActorId' + 144 ' WHERE "actorFollow"."targetActorId" = "videoChannel"."actorId" AND "actorFollow"."actorId" = :followerActorId ' +
145 ' AND "actorFollow"."state" = \'accepted\'' +
144 ' )' 146 ' )'
145 147
146 if (options.includeLocalVideos) { 148 if (options.includeLocalVideos) {