diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/models/video/video-query-builder.ts | 6 | ||||
-rw-r--r-- | server/models/video/video.ts | 2 |
2 files changed, 5 insertions, 3 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) { |
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 344bfc929..5aa40220e 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1366,7 +1366,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1366 | // Instances only share videos | 1366 | // Instances only share videos |
1367 | const query = 'SELECT 1 FROM "videoShare" ' + | 1367 | const query = 'SELECT 1 FROM "videoShare" ' + |
1368 | 'INNER JOIN "actorFollow" ON "actorFollow"."targetActorId" = "videoShare"."actorId" ' + | 1368 | 'INNER JOIN "actorFollow" ON "actorFollow"."targetActorId" = "videoShare"."actorId" ' + |
1369 | 'WHERE "actorFollow"."actorId" = $followerActorId AND "videoShare"."videoId" = $videoId ' + | 1369 | 'WHERE "actorFollow"."actorId" = $followerActorId AND "actorFollow"."state" = \'accepted\' AND "videoShare"."videoId" = $videoId ' + |
1370 | 'LIMIT 1' | 1370 | 'LIMIT 1' |
1371 | 1371 | ||
1372 | const options = { | 1372 | const options = { |