aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/overview/videos/video-list.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-10-29 10:54:27 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-10-29 11:48:21 +0200
commit3c10840fa90fc88fc98e8169faf4745ff6c80893 (patch)
tree9a60c4de766700fbc33804b06ec46279b20c855e /client/src/app/+admin/overview/videos/video-list.component.ts
parent2760b454a761f6af3138b2fb5f34340772ab0d1e (diff)
downloadPeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.tar.gz
PeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.tar.zst
PeerTube-3c10840fa90fc88fc98e8169faf4745ff6c80893.zip
Add video file size info in admin videos list
Diffstat (limited to 'client/src/app/+admin/overview/videos/video-list.component.ts')
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts
index dd9225e6a..6885abfc7 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.ts
+++ b/client/src/app/+admin/overview/videos/video-list.component.ts
@@ -3,7 +3,7 @@ import { Component, OnInit } from '@angular/core'
3import { ActivatedRoute, Router } from '@angular/router' 3import { ActivatedRoute, Router } from '@angular/router'
4import { AuthService, ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' 4import { AuthService, ConfirmService, Notifier, RestPagination, RestTable } from '@app/core'
5import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' 5import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
6import { UserRight, VideoPrivacy, VideoState } from '@shared/models' 6import { UserRight, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models'
7import { AdvancedInputFilter } from '@app/shared/shared-forms' 7import { AdvancedInputFilter } from '@app/shared/shared-forms'
8import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' 8import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature'
9 9
@@ -114,6 +114,24 @@ export class VideoListComponent extends RestTable implements OnInit {
114 return video.blacklisted 114 return video.blacklisted
115 } 115 }
116 116
117 isHLS (video: Video) {
118 return video.streamingPlaylists.some(p => p.type === VideoStreamingPlaylistType.HLS)
119 }
120
121 isWebTorrent (video: Video) {
122 return video.files.length !== 0
123 }
124
125 getFilesSize (video: Video) {
126 let files = video.files
127
128 if (this.isHLS(video)) {
129 files = files.concat(video.streamingPlaylists[0].files)
130 }
131
132 return files.reduce((p, f) => p += f.size, 0)
133 }
134
117 protected reloadData () { 135 protected reloadData () {
118 this.selectedVideos = [] 136 this.selectedVideos = []
119 137