diff options
Diffstat (limited to 'server/models/video/sql')
-rw-r--r-- | server/models/video/sql/videos-id-list-query-builder.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/models/video/sql/videos-id-list-query-builder.ts b/server/models/video/sql/videos-id-list-query-builder.ts index d4260c69c..7625c003d 100644 --- a/server/models/video/sql/videos-id-list-query-builder.ts +++ b/server/models/video/sql/videos-id-list-query-builder.ts | |||
@@ -35,6 +35,8 @@ export type BuildVideosListQueryOptions = { | |||
35 | tagsOneOf?: string[] | 35 | tagsOneOf?: string[] |
36 | tagsAllOf?: string[] | 36 | tagsAllOf?: string[] |
37 | 37 | ||
38 | uuids?: string[] | ||
39 | |||
38 | withFiles?: boolean | 40 | withFiles?: boolean |
39 | 41 | ||
40 | accountId?: number | 42 | accountId?: number |
@@ -161,6 +163,10 @@ export class VideosIdListQueryBuilder extends AbstractVideosQueryBuilder { | |||
161 | this.whereTagsAllOf(options.tagsAllOf) | 163 | this.whereTagsAllOf(options.tagsAllOf) |
162 | } | 164 | } |
163 | 165 | ||
166 | if (options.uuids) { | ||
167 | this.whereUUIDs(options.uuids) | ||
168 | } | ||
169 | |||
164 | if (options.nsfw === true) { | 170 | if (options.nsfw === true) { |
165 | this.whereNSFW() | 171 | this.whereNSFW() |
166 | } else if (options.nsfw === false) { | 172 | } else if (options.nsfw === false) { |
@@ -386,6 +392,10 @@ export class VideosIdListQueryBuilder extends AbstractVideosQueryBuilder { | |||
386 | ) | 392 | ) |
387 | } | 393 | } |
388 | 394 | ||
395 | private whereUUIDs (uuids: string[]) { | ||
396 | this.and.push('"video"."uuid" IN (' + createSafeIn(this.sequelize, uuids) + ')') | ||
397 | } | ||
398 | |||
389 | private whereCategoryOneOf (categoryOneOf: number[]) { | 399 | private whereCategoryOneOf (categoryOneOf: number[]) { |
390 | this.and.push('"video"."category" IN (:categoryOneOf)') | 400 | this.and.push('"video"."category" IN (:categoryOneOf)') |
391 | this.replacements.categoryOneOf = categoryOneOf | 401 | this.replacements.categoryOneOf = categoryOneOf |