aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-27 12:01:31 +0200
committerChocobozzz <me@florianbigard.com>2018-07-27 12:03:27 +0200
commit18dbb5b9723040e19fea1ed6b0c4f2738508ffc8 (patch)
tree17e6b48654726e8c9015547e764d000af4fdf1ca /server/models
parentf7714668917c7191a2d9d015d28c22baa92e32b4 (diff)
downloadPeerTube-18dbb5b9723040e19fea1ed6b0c4f2738508ffc8.tar.gz
PeerTube-18dbb5b9723040e19fea1ed6b0c4f2738508ffc8.tar.zst
PeerTube-18dbb5b9723040e19fea1ed6b0c4f2738508ffc8.zip
Revert SQL optimization in videos list :(
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 3a3cfbe85..33d62926b 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -215,8 +215,8 @@ type AvailableForListOptions = {
215 'INNER JOIN "videoChannel" ON "videoChannel"."id" = "video"."channelId" ' + 215 'INNER JOIN "videoChannel" ON "videoChannel"."id" = "video"."channelId" ' +
216 'INNER JOIN "account" ON "account"."id" = "videoChannel"."accountId" ' + 216 'INNER JOIN "account" ON "account"."id" = "videoChannel"."accountId" ' +
217 'INNER JOIN "actor" ON "account"."actorId" = "actor"."id" ' + 217 'INNER JOIN "actor" ON "account"."actorId" = "actor"."id" ' +
218 'WHERE "actor"."serverId" IS NULL OR ' + 218 'LEFT JOIN "actorFollow" ON "actorFollow"."targetActorId" = "actor"."id" ' +
219 '"actor"."id" IN (SELECT "targetActorId" FROM "actorFollow" WHERE "actorId" = 1)' + // Subquery for optimization 219 'WHERE "actor"."serverId" IS NULL OR "actorFollow"."actorId" = ' + actorIdNumber +
220 ')' 220 ')'
221 ) 221 )
222 }, 222 },
@@ -632,7 +632,7 @@ export class VideoModel extends Model<VideoModel> {
632 // Do not wait video deletion because we could be in a transaction 632 // Do not wait video deletion because we could be in a transaction
633 Promise.all(tasks) 633 Promise.all(tasks)
634 .catch(err => { 634 .catch(err => {
635 logger.error('Some errors when removing files of video %s in after destroy hook.', instance.uuid, { err }) 635 logger.error('Some errors when removing files of video %s in before destroy hook.', instance.uuid, { err })
636 }) 636 })
637 637
638 return undefined 638 return undefined