diff options
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/video/video.ts | 7 |
1 files changed, 4 insertions, 3 deletions
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<VideoModel> { | |||
1284 | videoPlaylistId?: number, | 1284 | videoPlaylistId?: number, |
1285 | trendingDays?: number, | 1285 | trendingDays?: number, |
1286 | user?: MUserAccountId, | 1286 | user?: MUserAccountId, |
1287 | historyOfUser?: MUserId | 1287 | historyOfUser?: MUserId, |
1288 | }, countVideos = true) { | 1288 | countVideos?: boolean |
1289 | }) { | ||
1289 | if (options.filter && options.filter === 'all-local' && !options.user.hasRight(UserRight.SEE_ALL_VIDEOS)) { | 1290 | if (options.filter && options.filter === 'all-local' && !options.user.hasRight(UserRight.SEE_ALL_VIDEOS)) { |
1290 | throw new Error('Try to filter all-local but no user has not the see all videos right') | 1291 | throw new Error('Try to filter all-local but no user has not the see all videos right') |
1291 | } | 1292 | } |
@@ -1328,7 +1329,7 @@ export class VideoModel extends Model<VideoModel> { | |||
1328 | trendingDays | 1329 | trendingDays |
1329 | } | 1330 | } |
1330 | 1331 | ||
1331 | return VideoModel.getAvailableForApi(query, queryOptions, countVideos) | 1332 | return VideoModel.getAvailableForApi(query, queryOptions, options.countVideos) |
1332 | } | 1333 | } |
1333 | 1334 | ||
1334 | static async searchAndPopulateAccountAndServer (options: { | 1335 | static async searchAndPopulateAccountAndServer (options: { |