aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/sql/video-model-get-query-builder.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/sql/video-model-get-query-builder.ts')
-rw-r--r--server/models/video/sql/video-model-get-query-builder.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/models/video/sql/video-model-get-query-builder.ts b/server/models/video/sql/video-model-get-query-builder.ts
index 1a921d802..892639076 100644
--- a/server/models/video/sql/video-model-get-query-builder.ts
+++ b/server/models/video/sql/video-model-get-query-builder.ts
@@ -1,8 +1,8 @@
1import { Sequelize, Transaction } from 'sequelize' 1import { Sequelize, Transaction } from 'sequelize'
2import { AbstractVideosModelQueryBuilder } from './shared/abstract-videos-model-query-builder' 2import { AbstractVideosModelQueryBuilder } from './shared/abstract-videos-model-query-builder'
3import { VideoAttributes } from './shared/video-attributes'
4import { VideoFileQueryBuilder } from './shared/video-file-query-builder' 3import { VideoFileQueryBuilder } from './shared/video-file-query-builder'
5import { VideoModelBuilder } from './shared/video-model-builder' 4import { VideoModelBuilder } from './shared/video-model-builder'
5import { VideoTables } from './shared/video-tables'
6 6
7/** 7/**
8 * 8 *
@@ -29,7 +29,7 @@ export class VideosModelGetQueryBuilder {
29 this.webtorrentFilesQueryBuilder = new VideoFileQueryBuilder(sequelize) 29 this.webtorrentFilesQueryBuilder = new VideoFileQueryBuilder(sequelize)
30 this.streamingPlaylistFilesQueryBuilder = new VideoFileQueryBuilder(sequelize) 30 this.streamingPlaylistFilesQueryBuilder = new VideoFileQueryBuilder(sequelize)
31 31
32 this.videoModelBuilder = new VideoModelBuilder('get', new VideoAttributes('get')) 32 this.videoModelBuilder = new VideoModelBuilder('get', new VideoTables('get'))
33 } 33 }
34 34
35 async queryVideos (options: BuildVideoGetQueryOptions) { 35 async queryVideos (options: BuildVideoGetQueryOptions) {
@@ -64,7 +64,7 @@ export class VideosModelGetQuerySubBuilder extends AbstractVideosModelQueryBuild
64 queryVideos (options: BuildVideoGetQueryOptions) { 64 queryVideos (options: BuildVideoGetQueryOptions) {
65 this.buildMainGetQuery(options) 65 this.buildMainGetQuery(options)
66 66
67 return this.runQuery(options.transaction, true) 67 return this.runQuery(options.transaction)
68 } 68 }
69 69
70 private buildMainGetQuery (options: BuildVideoGetQueryOptions) { 70 private buildMainGetQuery (options: BuildVideoGetQueryOptions) {
@@ -102,6 +102,6 @@ export class VideosModelGetQuerySubBuilder extends AbstractVideosModelQueryBuild
102 const order = 'ORDER BY "Tags"."name" ASC' 102 const order = 'ORDER BY "Tags"."name" ASC'
103 const from = `SELECT * FROM "video" ${this.where} LIMIT 1` 103 const from = `SELECT * FROM "video" ${this.where} LIMIT 1`
104 104
105 return `${this.buildSelect()} FROM (${from}) AS "video" ${this.joins.join(' ')} ${this.where} ${order}` 105 return `${this.buildSelect()} FROM (${from}) AS "video" ${this.joins.join(' ')} ${order}`
106 } 106 }
107} 107}