From fe98765624cdd6695739bda719fcb726b71c2b2a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 8 Jan 2020 14:15:16 +0100 Subject: Add ability to skip count query --- server/models/video/video.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server/models/video') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index e85c5e38e..cd3245ee4 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1284,8 +1284,9 @@ export class VideoModel extends Model { videoPlaylistId?: number, trendingDays?: number, user?: MUserAccountId, - historyOfUser?: MUserId - }, countVideos = true) { + historyOfUser?: MUserId, + countVideos?: boolean + }) { if (options.filter && options.filter === 'all-local' && !options.user.hasRight(UserRight.SEE_ALL_VIDEOS)) { throw new Error('Try to filter all-local but no user has not the see all videos right') } @@ -1328,7 +1329,7 @@ export class VideoModel extends Model { trendingDays } - return VideoModel.getAvailableForApi(query, queryOptions, countVideos) + return VideoModel.getAvailableForApi(query, queryOptions, options.countVideos) } static async searchAndPopulateAccountAndServer (options: { -- cgit v1.2.3