Fix insane SQL request when loading all video attributes
authorChocobozzz <me@florianbigard.com>
Wed, 23 May 2018 07:05:53 +0000 (09:05 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 23 May 2018 07:07:32 +0000 (09:07 +0200)
server/models/video/video.ts

index fe8c30655a31b1333f0529d0c6329b86ddbbe13f..967a899f50ad8239f2e23f21ef2300b354163372 100644 (file)
@@ -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()
       }
     ]