diff options
author | Chocobozzz <me@florianbigard.com> | 2021-10-29 10:54:27 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-10-29 11:48:21 +0200 |
commit | 3c10840fa90fc88fc98e8169faf4745ff6c80893 (patch) | |
tree | 9a60c4de766700fbc33804b06ec46279b20c855e /server/models/video/sql | |
parent | 2760b454a761f6af3138b2fb5f34340772ab0d1e (diff) | |
download | PeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.tar.gz PeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.tar.zst PeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.zip |
Add video file size info in admin videos list
Diffstat (limited to 'server/models/video/sql')
3 files changed, 6 insertions, 6 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 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 = { | |||
32 | logging?: boolean | 32 | logging?: boolean |
33 | } | 33 | } |
34 | 34 | ||
35 | export class VideosModelGetQueryBuilder { | 35 | export class VideoModelGetQueryBuilder { |
36 | videoQueryBuilder: VideosModelGetQuerySubBuilder | 36 | videoQueryBuilder: VideosModelGetQuerySubBuilder |
37 | webtorrentFilesQueryBuilder: VideoFileQueryBuilder | 37 | webtorrentFilesQueryBuilder: VideoFileQueryBuilder |
38 | streamingPlaylistFilesQueryBuilder: VideoFileQueryBuilder | 38 | streamingPlaylistFilesQueryBuilder: VideoFileQueryBuilder |
@@ -53,11 +53,11 @@ export class VideosModelGetQueryBuilder { | |||
53 | const [ videoRows, webtorrentFilesRows, streamingPlaylistFilesRows ] = await Promise.all([ | 53 | const [ videoRows, webtorrentFilesRows, streamingPlaylistFilesRows ] = await Promise.all([ |
54 | this.videoQueryBuilder.queryVideos(options), | 54 | this.videoQueryBuilder.queryVideos(options), |
55 | 55 | ||
56 | VideosModelGetQueryBuilder.videoFilesInclude.has(options.type) | 56 | VideoModelGetQueryBuilder.videoFilesInclude.has(options.type) |
57 | ? this.webtorrentFilesQueryBuilder.queryWebTorrentVideos(options) | 57 | ? this.webtorrentFilesQueryBuilder.queryWebTorrentVideos(options) |
58 | : Promise.resolve(undefined), | 58 | : Promise.resolve(undefined), |
59 | 59 | ||
60 | VideosModelGetQueryBuilder.videoFilesInclude.has(options.type) | 60 | VideoModelGetQueryBuilder.videoFilesInclude.has(options.type) |
61 | ? this.streamingPlaylistFilesQueryBuilder.queryStreamingPlaylistVideos(options) | 61 | ? this.streamingPlaylistFilesQueryBuilder.queryStreamingPlaylistVideos(options) |
62 | : Promise.resolve(undefined) | 62 | : Promise.resolve(undefined) |
63 | ]) | 63 | ]) |
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 = { | |||
43 | 43 | ||
44 | uuids?: string[] | 44 | uuids?: string[] |
45 | 45 | ||
46 | withFiles?: boolean | 46 | hasFiles?: boolean |
47 | 47 | ||
48 | accountId?: number | 48 | accountId?: number |
49 | videoChannelId?: number | 49 | videoChannelId?: number |
@@ -165,7 +165,7 @@ export class VideosIdListQueryBuilder extends AbstractVideosQueryBuilder { | |||
165 | this.whereFollowerActorId(options.displayOnlyForFollower) | 165 | this.whereFollowerActorId(options.displayOnlyForFollower) |
166 | } | 166 | } |
167 | 167 | ||
168 | if (options.withFiles === true) { | 168 | if (options.hasFiles === true) { |
169 | this.whereFileExists() | 169 | this.whereFileExists() |
170 | } | 170 | } |
171 | 171 | ||
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 | |||
52 | this.includeAccounts() | 52 | this.includeAccounts() |
53 | this.includeThumbnails() | 53 | this.includeThumbnails() |
54 | 54 | ||
55 | if (options.withFiles) { | 55 | if (options.include & VideoInclude.FILES) { |
56 | this.includeWebtorrentFiles() | 56 | this.includeWebtorrentFiles() |
57 | this.includeStreamingPlaylistFiles() | 57 | this.includeStreamingPlaylistFiles() |
58 | } | 58 | } |