]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-query-builder.ts
Avoid error when file has no torrent file
[github/Chocobozzz/PeerTube.git] / server / models / video / video-query-builder.ts
index 4d95ddee29a8b1fcaf5f7a561baae499c73e8a5c..155afe64be00ce66bbc7db1f4a5c51ba0c3d6224 100644 (file)
@@ -16,9 +16,11 @@ export type BuildVideosQueryOptions = {
   start: number
   sort: string
 
+  nsfw?: boolean
   filter?: VideoFilter
+  isLive?: boolean
+
   categoryOneOf?: number[]
-  nsfw?: boolean
   licenceOneOf?: number[]
   languageOneOf?: string[]
   tagsOneOf?: string[]
@@ -199,10 +201,14 @@ function buildListQuery (model: typeof Model, options: BuildVideosQueryOptions)
 
   if (options.nsfw === true) {
     and.push('"video"."nsfw" IS TRUE')
+  } else if (options.nsfw === false) {
+    and.push('"video"."nsfw" IS FALSE')
   }
 
-  if (options.nsfw === false) {
-    and.push('"video"."nsfw" IS FALSE')
+  if (options.isLive === true) {
+    and.push('"video"."isLive" IS TRUE')
+  } else if (options.isLive === false) {
+    and.push('"video"."isLive" IS FALSE')
   }
 
   if (options.categoryOneOf) {