diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-18 15:29:38 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-18 15:29:38 +0100 |
commit | 0aa52e170727ac6bdf441bcaa2353ae0b8a354ed (patch) | |
tree | 52fa047cf9970590cab1dcc7a3e5caa8eb004171 /server/models/video | |
parent | ff2cac9fa361a3c5489078f441ed54230c045971 (diff) | |
download | PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.gz PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.tar.zst PeerTube-0aa52e170727ac6bdf441bcaa2353ae0b8a354ed.zip |
Add ability to display all channel/account videos
Diffstat (limited to 'server/models/video')
-rw-r--r-- | server/models/video/video-query-builder.ts | 2 | ||||
-rw-r--r-- | server/models/video/video.ts | 2 |
2 files changed, 2 insertions, 2 deletions
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) | |||
89 | } | 89 | } |
90 | 90 | ||
91 | // Only list public/published videos | 91 | // Only list public/published videos |
92 | if (!options.filter || options.filter !== 'all-local') { | 92 | if (!options.filter || (options.filter !== 'all-local' && options.filter !== 'all')) { |
93 | and.push( | 93 | and.push( |
94 | `("video"."state" = ${VideoState.PUBLISHED} OR ` + | 94 | `("video"."state" = ${VideoState.PUBLISHED} OR ` + |
95 | `("video"."state" = ${VideoState.TO_TRANSCODE} AND "video"."waitTranscoding" IS false))` | 95 | `("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<VideoModel> { | |||
1085 | historyOfUser?: MUserId | 1085 | historyOfUser?: MUserId |
1086 | countVideos?: boolean | 1086 | countVideos?: boolean |
1087 | }) { | 1087 | }) { |
1088 | if (options.filter && options.filter === 'all-local' && !options.user.hasRight(UserRight.SEE_ALL_VIDEOS)) { | 1088 | if ((options.filter === 'all-local' || options.filter === 'all') && !options.user.hasRight(UserRight.SEE_ALL_VIDEOS)) { |
1089 | throw new Error('Try to filter all-local but no user has not the see all videos right') | 1089 | throw new Error('Try to filter all-local but no user has not the see all videos right') |
1090 | } | 1090 | } |
1091 | 1091 | ||