diff options
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.ts | 11 |
1 files changed, 6 insertions, 5 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 2f34d5602..a65c96097 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 @@ | |||
1 | import { Sequelize, Transaction } from 'sequelize' | 1 | import { Sequelize, Transaction } from 'sequelize' |
2 | import { AbstractVideosModelQueryBuilder } from './shared/abstract-videos-model-query-builder' | 2 | import { AbstractVideoQueryBuilder } from './shared/abstract-video-query-builder' |
3 | import { VideoFileQueryBuilder } from './shared/video-file-query-builder' | 3 | import { VideoFileQueryBuilder } from './shared/video-file-query-builder' |
4 | import { VideoModelBuilder } from './shared/video-model-builder' | 4 | import { VideoModelBuilder } from './shared/video-model-builder' |
5 | import { VideoTables } from './shared/video-tables' | 5 | import { VideoTableAttributes } from './shared/video-table-attributes' |
6 | 6 | ||
7 | /** | 7 | /** |
8 | * | 8 | * |
@@ -46,7 +46,7 @@ export class VideoModelGetQueryBuilder { | |||
46 | this.webtorrentFilesQueryBuilder = new VideoFileQueryBuilder(sequelize) | 46 | this.webtorrentFilesQueryBuilder = new VideoFileQueryBuilder(sequelize) |
47 | this.streamingPlaylistFilesQueryBuilder = new VideoFileQueryBuilder(sequelize) | 47 | this.streamingPlaylistFilesQueryBuilder = new VideoFileQueryBuilder(sequelize) |
48 | 48 | ||
49 | this.videoModelBuilder = new VideoModelBuilder('get', new VideoTables('get')) | 49 | this.videoModelBuilder = new VideoModelBuilder('get', new VideoTableAttributes('get')) |
50 | } | 50 | } |
51 | 51 | ||
52 | async queryVideo (options: BuildVideoGetQueryOptions) { | 52 | async queryVideo (options: BuildVideoGetQueryOptions) { |
@@ -69,15 +69,16 @@ export class VideoModelGetQueryBuilder { | |||
69 | }) | 69 | }) |
70 | 70 | ||
71 | if (videos.length > 1) { | 71 | if (videos.length > 1) { |
72 | throw new Error('Video results is more than ') | 72 | throw new Error('Video results is more than 1') |
73 | } | 73 | } |
74 | 74 | ||
75 | if (videos.length === 0) return null | 75 | if (videos.length === 0) return null |
76 | |||
76 | return videos[0] | 77 | return videos[0] |
77 | } | 78 | } |
78 | } | 79 | } |
79 | 80 | ||
80 | export class VideosModelGetQuerySubBuilder extends AbstractVideosModelQueryBuilder { | 81 | export class VideosModelGetQuerySubBuilder extends AbstractVideoQueryBuilder { |
81 | protected attributes: { [key: string]: string } | 82 | protected attributes: { [key: string]: string } |
82 | 83 | ||
83 | protected webtorrentFilesQuery: string | 84 | protected webtorrentFilesQuery: string |