aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/sql
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-20 14:15:15 +0200
committerChocobozzz <me@florianbigard.com>2021-07-21 13:35:31 +0200
commit4d029ef8ec3d5274eeaa3ee6d808eb7035e7faef (patch)
tree20bcdd660ab4eb731814db3a4a40fffb48ce7482 /server/models/video/sql
parent7f28f2ddbaeecf451d501e99ded0408c14a33600 (diff)
downloadPeerTube-4d029ef8ec3d5274eeaa3ee6d808eb7035e7faef.tar.gz
PeerTube-4d029ef8ec3d5274eeaa3ee6d808eb7035e7faef.tar.zst
PeerTube-4d029ef8ec3d5274eeaa3ee6d808eb7035e7faef.zip
Add ability for instances to follow any actor
Diffstat (limited to 'server/models/video/sql')
-rw-r--r--server/models/video/sql/videos-id-list-query-builder.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/video/sql/videos-id-list-query-builder.ts b/server/models/video/sql/videos-id-list-query-builder.ts
index 30b251f0f..054f71c8c 100644
--- a/server/models/video/sql/videos-id-list-query-builder.ts
+++ b/server/models/video/sql/videos-id-list-query-builder.ts
@@ -304,16 +304,16 @@ export class VideosIdListQueryBuilder extends AbstractVideosQueryBuilder {
304 private whereFollowerActorId (followerActorId: number, includeLocalVideos: boolean) { 304 private whereFollowerActorId (followerActorId: number, includeLocalVideos: boolean) {
305 let query = 305 let query =
306 '(' + 306 '(' +
307 ' EXISTS (' + 307 ' EXISTS (' + // Videos shared by actors we follow
308 ' SELECT 1 FROM "videoShare" ' + 308 ' SELECT 1 FROM "videoShare" ' +
309 ' INNER JOIN "actorFollow" "actorFollowShare" ON "actorFollowShare"."targetActorId" = "videoShare"."actorId" ' + 309 ' INNER JOIN "actorFollow" "actorFollowShare" ON "actorFollowShare"."targetActorId" = "videoShare"."actorId" ' +
310 ' AND "actorFollowShare"."actorId" = :followerActorId AND "actorFollowShare"."state" = \'accepted\' ' + 310 ' AND "actorFollowShare"."actorId" = :followerActorId AND "actorFollowShare"."state" = \'accepted\' ' +
311 ' WHERE "videoShare"."videoId" = "video"."id"' + 311 ' WHERE "videoShare"."videoId" = "video"."id"' +
312 ' )' + 312 ' )' +
313 ' OR' + 313 ' OR' +
314 ' EXISTS (' + 314 ' EXISTS (' + // Videos published by accounts we follow
315 ' SELECT 1 from "actorFollow" ' + 315 ' SELECT 1 from "actorFollow" ' +
316 ' WHERE "actorFollow"."targetActorId" = "videoChannel"."actorId" AND "actorFollow"."actorId" = :followerActorId ' + 316 ' WHERE "actorFollow"."targetActorId" = "account"."actorId" AND "actorFollow"."actorId" = :followerActorId ' +
317 ' AND "actorFollow"."state" = \'accepted\'' + 317 ' AND "actorFollow"."state" = \'accepted\'' +
318 ' )' 318 ' )'
319 319