From: Chocobozzz Date: Wed, 23 May 2018 07:05:53 +0000 (+0200) Subject: Fix insane SQL request when loading all video attributes X-Git-Tag: v1.0.0-beta.6~3 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e1a540b5fa14b0fafa63f99e344927b10fdbee00;p=oweals%2Fpeertube.git Fix insane SQL request when loading all video attributes --- diff --git a/server/models/video/video.ts b/server/models/video/video.ts index fe8c30655..967a899f5 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -271,6 +271,7 @@ enum ScopeNames { [ScopeNames.WITH_SHARES]: { include: [ { + ['separate' as any]: true, model: () => VideoShareModel.unscoped() } ] @@ -278,6 +279,7 @@ enum ScopeNames { [ScopeNames.WITH_RATES]: { include: [ { + ['separate' as any]: true, model: () => AccountVideoRateModel, include: [ { @@ -297,6 +299,7 @@ enum ScopeNames { [ScopeNames.WITH_COMMENTS]: { include: [ { + ['separate' as any]: true, model: () => VideoCommentModel.unscoped() } ]