From 0aa52e170727ac6bdf441bcaa2353ae0b8a354ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 18 Nov 2020 15:29:38 +0100 Subject: Add ability to display all channel/account videos --- server/models/video/video-query-builder.ts | 2 +- server/models/video/video.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'server/models/video') diff --git a/server/models/video/video-query-builder.ts b/server/models/video/video-query-builder.ts index b14bb16d6..25d5042b7 100644 --- a/server/models/video/video-query-builder.ts +++ b/server/models/video/video-query-builder.ts @@ -89,7 +89,7 @@ function buildListQuery (model: typeof Model, options: BuildVideosQueryOptions) } // Only list public/published videos - if (!options.filter || options.filter !== 'all-local') { + if (!options.filter || (options.filter !== 'all-local' && options.filter !== 'all')) { and.push( `("video"."state" = ${VideoState.PUBLISHED} OR ` + `("video"."state" = ${VideoState.TO_TRANSCODE} AND "video"."waitTranscoding" IS false))` diff --git a/server/models/video/video.ts b/server/models/video/video.ts index edf757697..f365d3d51 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1085,7 +1085,7 @@ export class VideoModel extends Model { historyOfUser?: MUserId countVideos?: boolean }) { - if (options.filter && options.filter === 'all-local' && !options.user.hasRight(UserRight.SEE_ALL_VIDEOS)) { + if ((options.filter === 'all-local' || options.filter === 'all') && !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') } -- cgit v1.2.3