]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/sql/videos-id-list-query-builder.ts
Add ability to view my followers
[github/Chocobozzz/PeerTube.git] / server / models / video / sql / videos-id-list-query-builder.ts
index d4260c69c6e274434893d976ab1fdca22974841f..7625c003d0fbc6cc4d9a90f3951e7d0798987c91 100644 (file)
@@ -35,6 +35,8 @@ export type BuildVideosListQueryOptions = {
   tagsOneOf?: string[]
   tagsAllOf?: string[]
 
+  uuids?: string[]
+
   withFiles?: boolean
 
   accountId?: number
@@ -161,6 +163,10 @@ export class VideosIdListQueryBuilder extends AbstractVideosQueryBuilder {
       this.whereTagsAllOf(options.tagsAllOf)
     }
 
+    if (options.uuids) {
+      this.whereUUIDs(options.uuids)
+    }
+
     if (options.nsfw === true) {
       this.whereNSFW()
     } else if (options.nsfw === false) {
@@ -386,6 +392,10 @@ export class VideosIdListQueryBuilder extends AbstractVideosQueryBuilder {
     )
   }
 
+  private whereUUIDs (uuids: string[]) {
+    this.and.push('"video"."uuid" IN (' + createSafeIn(this.sequelize, uuids) + ')')
+  }
+
   private whereCategoryOneOf (categoryOneOf: number[]) {
     this.and.push('"video"."category" IN (:categoryOneOf)')
     this.replacements.categoryOneOf = categoryOneOf