diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-11 11:27:45 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-11 11:27:45 +0200 |
commit | 3c79c2ce86eaf9e151ab6c2c9d1f646968a16744 (patch) | |
tree | fa7e993359e070395a45ecb7a19e9c580d88ff61 /server/models/video/sql/video-model-get-query-builder.ts | |
parent | 17bb45388ec319d288a1b8387c6c199fe2f6b64f (diff) | |
download | PeerTube-3c79c2ce86eaf9e151ab6c2c9d1f646968a16744.tar.gz PeerTube-3c79c2ce86eaf9e151ab6c2c9d1f646968a16744.tar.zst PeerTube-3c79c2ce86eaf9e151ab6c2c9d1f646968a16744.zip |
Optimize join build
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 | 3 |
1 files changed, 1 insertions, 2 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 892639076..4aab9ff1d 100644 --- a/server/models/video/sql/video-model-get-query-builder.ts +++ b/server/models/video/sql/video-model-get-query-builder.ts | |||
@@ -52,7 +52,6 @@ export class VideosModelGetQueryBuilder { | |||
52 | 52 | ||
53 | export class VideosModelGetQuerySubBuilder extends AbstractVideosModelQueryBuilder { | 53 | export class VideosModelGetQuerySubBuilder extends AbstractVideosModelQueryBuilder { |
54 | protected attributes: { [key: string]: string } | 54 | protected attributes: { [key: string]: string } |
55 | protected joins: string[] = [] | ||
56 | 55 | ||
57 | protected webtorrentFilesQuery: string | 56 | protected webtorrentFilesQuery: string |
58 | protected streamingPlaylistFilesQuery: string | 57 | protected streamingPlaylistFilesQuery: string |
@@ -102,6 +101,6 @@ export class VideosModelGetQuerySubBuilder extends AbstractVideosModelQueryBuild | |||
102 | const order = 'ORDER BY "Tags"."name" ASC' | 101 | const order = 'ORDER BY "Tags"."name" ASC' |
103 | const from = `SELECT * FROM "video" ${this.where} LIMIT 1` | 102 | const from = `SELECT * FROM "video" ${this.where} LIMIT 1` |
104 | 103 | ||
105 | return `${this.buildSelect()} FROM (${from}) AS "video" ${this.joins.join(' ')} ${order}` | 104 | return `${this.buildSelect()} FROM (${from}) AS "video" ${this.joins} ${order}` |
106 | } | 105 | } |
107 | } | 106 | } |