diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index 4e6f602aa..c0a7892a4 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -1126,15 +1126,11 @@ export class VideoModel extends Model<VideoModel> { | |||
1126 | const countQuery = buildBaseQuery() | 1126 | const countQuery = buildBaseQuery() |
1127 | const findQuery = buildBaseQuery() | 1127 | const findQuery = buildBaseQuery() |
1128 | 1128 | ||
1129 | findQuery.include.push({ | 1129 | const findScopes = [ |
1130 | model: ScheduleVideoUpdateModel, | 1130 | ScopeNames.WITH_SCHEDULED_UPDATE, |
1131 | required: false | 1131 | ScopeNames.WITH_BLACKLISTED, |
1132 | }) | 1132 | ScopeNames.WITH_THUMBNAILS |
1133 | 1133 | ] | |
1134 | findQuery.include.push({ | ||
1135 | model: VideoBlacklistModel, | ||
1136 | required: false | ||
1137 | }) | ||
1138 | 1134 | ||
1139 | if (withFiles === true) { | 1135 | if (withFiles === true) { |
1140 | findQuery.include.push({ | 1136 | findQuery.include.push({ |
@@ -1145,7 +1141,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1145 | 1141 | ||
1146 | return Promise.all([ | 1142 | return Promise.all([ |
1147 | VideoModel.count(countQuery), | 1143 | VideoModel.count(countQuery), |
1148 | VideoModel.findAll(findQuery) | 1144 | VideoModel.scope(findScopes).findAll(findQuery) |
1149 | ]).then(([ count, rows ]) => { | 1145 | ]).then(([ count, rows ]) => { |
1150 | return { | 1146 | return { |
1151 | data: rows, | 1147 | data: rows, |