From a18f275d302bbd95443c258b8d92f6dfd8eb1653 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 26 Apr 2019 10:20:58 +0200 Subject: Fix thumbnail when listing my videos --- server/models/video/video.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'server/models') 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 { const countQuery = buildBaseQuery() const findQuery = buildBaseQuery() - findQuery.include.push({ - model: ScheduleVideoUpdateModel, - required: false - }) - - findQuery.include.push({ - model: VideoBlacklistModel, - required: false - }) + const findScopes = [ + ScopeNames.WITH_SCHEDULED_UPDATE, + ScopeNames.WITH_BLACKLISTED, + ScopeNames.WITH_THUMBNAILS + ] if (withFiles === true) { findQuery.include.push({ @@ -1145,7 +1141,7 @@ export class VideoModel extends Model { return Promise.all([ VideoModel.count(countQuery), - VideoModel.findAll(findQuery) + VideoModel.scope(findScopes).findAll(findQuery) ]).then(([ count, rows ]) => { return { data: rows, -- cgit v1.2.3