From 668f864f5a50bd34ffd7c32c91bfff122118d4bf Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 11 Jun 2021 16:02:26 +0200 Subject: Fix live files include --- .../video/sql/shared/abstract-videos-model-query-builder.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'server/models/video/sql/shared/abstract-videos-model-query-builder.ts') 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 } } - protected includeWebtorrentFiles (required: boolean) { - const joinType = required ? 'INNER' : 'LEFT' - this.addJoin(joinType + ' JOIN "videoFile" AS "VideoFiles" ON "VideoFiles"."videoId" = "video"."id"') + protected includeWebtorrentFiles () { + this.addJoin('LEFT JOIN "videoFile" AS "VideoFiles" ON "VideoFiles"."videoId" = "video"."id"') this.attributes = { ...this.attributes, @@ -113,15 +112,13 @@ export class AbstractVideosModelQueryBuilder extends AbstractVideosQueryBuilder } } - protected includeStreamingPlaylistFiles (required: boolean) { - const joinType = required ? 'INNER' : 'LEFT' - + protected includeStreamingPlaylistFiles () { this.addJoin( - joinType + ' JOIN "videoStreamingPlaylist" AS "VideoStreamingPlaylists" ON "VideoStreamingPlaylists"."videoId" = "video"."id"' + 'LEFT JOIN "videoStreamingPlaylist" AS "VideoStreamingPlaylists" ON "VideoStreamingPlaylists"."videoId" = "video"."id"' ) this.addJoin( - joinType + ' JOIN "videoFile" AS "VideoStreamingPlaylists->VideoFiles" ' + + 'LEFT JOIN "videoFile" AS "VideoStreamingPlaylists->VideoFiles" ' + 'ON "VideoStreamingPlaylists->VideoFiles"."videoStreamingPlaylistId" = "VideoStreamingPlaylists"."id"' ) -- cgit v1.2.3