diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-11 16:02:26 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-11 16:02:26 +0200 |
commit | 668f864f5a50bd34ffd7c32c91bfff122118d4bf (patch) | |
tree | 8ee891b0aee157950b34d5b106135b86206f40d2 /server/models/video/sql/shared/abstract-videos-model-query-builder.ts | |
parent | b8afe6f0cd32177a3670ac0850db5b58678db5f8 (diff) | |
download | PeerTube-668f864f5a50bd34ffd7c32c91bfff122118d4bf.tar.gz PeerTube-668f864f5a50bd34ffd7c32c91bfff122118d4bf.tar.zst PeerTube-668f864f5a50bd34ffd7c32c91bfff122118d4bf.zip |
Fix live files include
Diffstat (limited to 'server/models/video/sql/shared/abstract-videos-model-query-builder.ts')
-rw-r--r-- | server/models/video/sql/shared/abstract-videos-model-query-builder.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/server/models/video/sql/shared/abstract-videos-model-query-builder.ts b/server/models/video/sql/shared/abstract-videos-model-query-builder.ts index d959cb5d0..0d7e64574 100644 --- a/server/models/video/sql/shared/abstract-videos-model-query-builder.ts +++ b/server/models/video/sql/shared/abstract-videos-model-query-builder.ts | |||
@@ -102,9 +102,8 @@ export class AbstractVideosModelQueryBuilder extends AbstractVideosQueryBuilder | |||
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | protected includeWebtorrentFiles (required: boolean) { | 105 | protected includeWebtorrentFiles () { |
106 | const joinType = required ? 'INNER' : 'LEFT' | 106 | this.addJoin('LEFT JOIN "videoFile" AS "VideoFiles" ON "VideoFiles"."videoId" = "video"."id"') |
107 | this.addJoin(joinType + ' JOIN "videoFile" AS "VideoFiles" ON "VideoFiles"."videoId" = "video"."id"') | ||
108 | 107 | ||
109 | this.attributes = { | 108 | this.attributes = { |
110 | ...this.attributes, | 109 | ...this.attributes, |
@@ -113,15 +112,13 @@ export class AbstractVideosModelQueryBuilder extends AbstractVideosQueryBuilder | |||
113 | } | 112 | } |
114 | } | 113 | } |
115 | 114 | ||
116 | protected includeStreamingPlaylistFiles (required: boolean) { | 115 | protected includeStreamingPlaylistFiles () { |
117 | const joinType = required ? 'INNER' : 'LEFT' | ||
118 | |||
119 | this.addJoin( | 116 | this.addJoin( |
120 | joinType + ' JOIN "videoStreamingPlaylist" AS "VideoStreamingPlaylists" ON "VideoStreamingPlaylists"."videoId" = "video"."id"' | 117 | 'LEFT JOIN "videoStreamingPlaylist" AS "VideoStreamingPlaylists" ON "VideoStreamingPlaylists"."videoId" = "video"."id"' |
121 | ) | 118 | ) |
122 | 119 | ||
123 | this.addJoin( | 120 | this.addJoin( |
124 | joinType + ' JOIN "videoFile" AS "VideoStreamingPlaylists->VideoFiles" ' + | 121 | 'LEFT JOIN "videoFile" AS "VideoStreamingPlaylists->VideoFiles" ' + |
125 | 'ON "VideoStreamingPlaylists->VideoFiles"."videoStreamingPlaylistId" = "VideoStreamingPlaylists"."id"' | 122 | 'ON "VideoStreamingPlaylists->VideoFiles"."videoStreamingPlaylistId" = "VideoStreamingPlaylists"."id"' |
126 | ) | 123 | ) |
127 | 124 | ||