From 3c10840fa90fc88fc98e8169faf4745ff6c80893 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 Oct 2021 10:54:27 +0200 Subject: Add video file size info in admin videos list --- server/models/video/sql/video-model-get-query-builder.ts | 6 +++--- server/models/video/sql/videos-id-list-query-builder.ts | 4 ++-- server/models/video/sql/videos-model-list-query-builder.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'server/models/video/sql') 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 d18ddae67..2f34d5602 100644 --- a/server/models/video/sql/video-model-get-query-builder.ts +++ b/server/models/video/sql/video-model-get-query-builder.ts @@ -32,7 +32,7 @@ export type BuildVideoGetQueryOptions = { logging?: boolean } -export class VideosModelGetQueryBuilder { +export class VideoModelGetQueryBuilder { videoQueryBuilder: VideosModelGetQuerySubBuilder webtorrentFilesQueryBuilder: VideoFileQueryBuilder streamingPlaylistFilesQueryBuilder: VideoFileQueryBuilder @@ -53,11 +53,11 @@ export class VideosModelGetQueryBuilder { const [ videoRows, webtorrentFilesRows, streamingPlaylistFilesRows ] = await Promise.all([ this.videoQueryBuilder.queryVideos(options), - VideosModelGetQueryBuilder.videoFilesInclude.has(options.type) + VideoModelGetQueryBuilder.videoFilesInclude.has(options.type) ? this.webtorrentFilesQueryBuilder.queryWebTorrentVideos(options) : Promise.resolve(undefined), - VideosModelGetQueryBuilder.videoFilesInclude.has(options.type) + VideoModelGetQueryBuilder.videoFilesInclude.has(options.type) ? this.streamingPlaylistFilesQueryBuilder.queryStreamingPlaylistVideos(options) : Promise.resolve(undefined) ]) diff --git a/server/models/video/sql/videos-id-list-query-builder.ts b/server/models/video/sql/videos-id-list-query-builder.ts index 3eb547e75..4d6e0ea4b 100644 --- a/server/models/video/sql/videos-id-list-query-builder.ts +++ b/server/models/video/sql/videos-id-list-query-builder.ts @@ -43,7 +43,7 @@ export type BuildVideosListQueryOptions = { uuids?: string[] - withFiles?: boolean + hasFiles?: boolean accountId?: number videoChannelId?: number @@ -165,7 +165,7 @@ export class VideosIdListQueryBuilder extends AbstractVideosQueryBuilder { this.whereFollowerActorId(options.displayOnlyForFollower) } - if (options.withFiles === true) { + if (options.hasFiles === true) { this.whereFileExists() } diff --git a/server/models/video/sql/videos-model-list-query-builder.ts b/server/models/video/sql/videos-model-list-query-builder.ts index ef92bd2b0..cd721f055 100644 --- a/server/models/video/sql/videos-model-list-query-builder.ts +++ b/server/models/video/sql/videos-model-list-query-builder.ts @@ -52,7 +52,7 @@ export class VideosModelListQueryBuilder extends AbstractVideosModelQueryBuilder this.includeAccounts() this.includeThumbnails() - if (options.withFiles) { + if (options.include & VideoInclude.FILES) { this.includeWebtorrentFiles() this.includeStreamingPlaylistFiles() } -- cgit v1.2.3