aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-23 09:05:53 +0200
committerChocobozzz <me@florianbigard.com>2018-05-23 09:07:32 +0200
commite1a540b5fa14b0fafa63f99e344927b10fdbee00 (patch)
treeedd2c582f9498ca8a1cda5ca31bd186b64bf7ac4 /server/models
parent7e2b4ecdcc679cef05716e78135bfb2a9b9d1427 (diff)
downloadPeerTube-e1a540b5fa14b0fafa63f99e344927b10fdbee00.tar.gz
PeerTube-e1a540b5fa14b0fafa63f99e344927b10fdbee00.tar.zst
PeerTube-e1a540b5fa14b0fafa63f99e344927b10fdbee00.zip
Fix insane SQL request when loading all video attributes
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video.ts3
1 files changed, 3 insertions, 0 deletions
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 {
271 [ScopeNames.WITH_SHARES]: { 271 [ScopeNames.WITH_SHARES]: {
272 include: [ 272 include: [
273 { 273 {
274 ['separate' as any]: true,
274 model: () => VideoShareModel.unscoped() 275 model: () => VideoShareModel.unscoped()
275 } 276 }
276 ] 277 ]
@@ -278,6 +279,7 @@ enum ScopeNames {
278 [ScopeNames.WITH_RATES]: { 279 [ScopeNames.WITH_RATES]: {
279 include: [ 280 include: [
280 { 281 {
282 ['separate' as any]: true,
281 model: () => AccountVideoRateModel, 283 model: () => AccountVideoRateModel,
282 include: [ 284 include: [
283 { 285 {
@@ -297,6 +299,7 @@ enum ScopeNames {
297 [ScopeNames.WITH_COMMENTS]: { 299 [ScopeNames.WITH_COMMENTS]: {
298 include: [ 300 include: [
299 { 301 {
302 ['separate' as any]: true,
300 model: () => VideoCommentModel.unscoped() 303 model: () => VideoCommentModel.unscoped()
301 } 304 }
302 ] 305 ]