aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-query-builder.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video-query-builder.ts')
-rw-r--r--server/models/video/video-query-builder.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/server/models/video/video-query-builder.ts b/server/models/video/video-query-builder.ts
index 4d95ddee2..155afe64b 100644
--- a/server/models/video/video-query-builder.ts
+++ b/server/models/video/video-query-builder.ts
@@ -16,9 +16,11 @@ export type BuildVideosQueryOptions = {
16 start: number 16 start: number
17 sort: string 17 sort: string
18 18
19 nsfw?: boolean
19 filter?: VideoFilter 20 filter?: VideoFilter
21 isLive?: boolean
22
20 categoryOneOf?: number[] 23 categoryOneOf?: number[]
21 nsfw?: boolean
22 licenceOneOf?: number[] 24 licenceOneOf?: number[]
23 languageOneOf?: string[] 25 languageOneOf?: string[]
24 tagsOneOf?: string[] 26 tagsOneOf?: string[]
@@ -199,10 +201,14 @@ function buildListQuery (model: typeof Model, options: BuildVideosQueryOptions)
199 201
200 if (options.nsfw === true) { 202 if (options.nsfw === true) {
201 and.push('"video"."nsfw" IS TRUE') 203 and.push('"video"."nsfw" IS TRUE')
204 } else if (options.nsfw === false) {
205 and.push('"video"."nsfw" IS FALSE')
202 } 206 }
203 207
204 if (options.nsfw === false) { 208 if (options.isLive === true) {
205 and.push('"video"."nsfw" IS FALSE') 209 and.push('"video"."isLive" IS TRUE')
210 } else if (options.isLive === false) {
211 and.push('"video"."isLive" IS FALSE')
206 } 212 }
207 213
208 if (options.categoryOneOf) { 214 if (options.categoryOneOf) {