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 --- client/src/app/shared/shared-main/video/video-details.model.ts | 4 +--- client/src/app/shared/shared-main/video/video.model.ts | 10 +++++++++- client/src/app/shared/shared-main/video/video.service.ts | 6 +++++- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-main/video/video-details.model.ts b/client/src/app/shared/shared-main/video/video-details.model.ts index f060d1dc9..45c053507 100644 --- a/client/src/app/shared/shared-main/video/video-details.model.ts +++ b/client/src/app/shared/shared-main/video/video-details.model.ts @@ -15,7 +15,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { support: string channel: VideoChannel tags: string[] - files: VideoFile[] account: Account commentsEnabled: boolean downloadEnabled: boolean @@ -28,13 +27,13 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { trackerUrls: string[] + files: VideoFile[] streamingPlaylists: VideoStreamingPlaylist[] constructor (hash: VideoDetailsServerModel, translations = {}) { super(hash, translations) this.descriptionPath = hash.descriptionPath - this.files = hash.files this.channel = new VideoChannel(hash.channel) this.account = new Account(hash.account) this.tags = hash.tags @@ -43,7 +42,6 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { this.downloadEnabled = hash.downloadEnabled this.trackerUrls = hash.trackerUrls - this.streamingPlaylists = hash.streamingPlaylists this.buildLikeAndDislikePercents() } diff --git a/client/src/app/shared/shared-main/video/video.model.ts b/client/src/app/shared/shared-main/video/video.model.ts index 699eac7f1..b11316471 100644 --- a/client/src/app/shared/shared-main/video/video.model.ts +++ b/client/src/app/shared/shared-main/video/video.model.ts @@ -10,9 +10,11 @@ import { UserRight, Video as VideoServerModel, VideoConstant, + VideoFile, VideoPrivacy, VideoScheduleUpdate, - VideoState + VideoState, + VideoStreamingPlaylist } from '@shared/models' export class Video implements VideoServerModel { @@ -96,6 +98,9 @@ export class Video implements VideoServerModel { pluginData?: any + streamingPlaylists?: VideoStreamingPlaylist[] + files?: VideoFile[] + static buildWatchUrl (video: Partial>) { return buildVideoWatchPath({ shortUUID: video.shortUUID || video.uuid }) } @@ -172,6 +177,9 @@ export class Video implements VideoServerModel { this.blockedOwner = hash.blockedOwner this.blockedServer = hash.blockedServer + this.streamingPlaylists = hash.streamingPlaylists + this.files = hash.files + this.userHistory = hash.userHistory this.originInstanceHost = this.account.host diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index 0a3a51b0c..5db9a8704 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts @@ -208,7 +208,11 @@ export class VideoService { ): Observable> { const { pagination, search } = parameters - const include = VideoInclude.BLACKLISTED | VideoInclude.BLOCKED_OWNER | VideoInclude.HIDDEN_PRIVACY | VideoInclude.NOT_PUBLISHED_STATE + const include = VideoInclude.BLACKLISTED | + VideoInclude.BLOCKED_OWNER | + VideoInclude.HIDDEN_PRIVACY | + VideoInclude.NOT_PUBLISHED_STATE | + VideoInclude.FILES let params = new HttpParams() params = this.buildCommonVideosParams({ params, include, ...parameters }) -- cgit v1.2.3