diff options
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.ts | 32 |
1 files changed, 29 insertions, 3 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 3c21adb44..4aed5221b 100644 --- a/client/src/app/+admin/overview/videos/video-list.component.ts +++ b/client/src/app/+admin/overview/videos/video-list.component.ts | |||
@@ -40,7 +40,8 @@ export class VideoListComponent extends RestTable implements OnInit { | |||
40 | duplicate: true, | 40 | duplicate: true, |
41 | mute: true, | 41 | mute: true, |
42 | liveInfo: false, | 42 | liveInfo: false, |
43 | removeFiles: true | 43 | removeFiles: true, |
44 | transcoding: true | ||
44 | } | 45 | } |
45 | 46 | ||
46 | loading = true | 47 | loading = true |
@@ -90,15 +91,27 @@ export class VideoListComponent extends RestTable implements OnInit { | |||
90 | ], | 91 | ], |
91 | [ | 92 | [ |
92 | { | 93 | { |
94 | label: $localize`Run HLS transcoding`, | ||
95 | handler: videos => this.runTranscoding(videos, 'hls'), | ||
96 | isDisplayed: videos => videos.every(v => v.canRunTranscoding(this.authUser)), | ||
97 | iconName: 'cog' | ||
98 | }, | ||
99 | { | ||
100 | label: $localize`Run WebTorrent transcoding`, | ||
101 | handler: videos => this.runTranscoding(videos, 'webtorrent'), | ||
102 | isDisplayed: videos => videos.every(v => v.canRunTranscoding(this.authUser)), | ||
103 | iconName: 'cog' | ||
104 | }, | ||
105 | { | ||
93 | label: $localize`Delete HLS files`, | 106 | label: $localize`Delete HLS files`, |
94 | handler: videos => this.removeVideoFiles(videos, 'hls'), | 107 | handler: videos => this.removeVideoFiles(videos, 'hls'), |
95 | isDisplayed: videos => this.authUser.hasRight(UserRight.MANAGE_VIDEO_FILES) && videos.every(v => v.hasHLS() && v.hasWebTorrent()), | 108 | isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)), |
96 | iconName: 'delete' | 109 | iconName: 'delete' |
97 | }, | 110 | }, |
98 | { | 111 | { |
99 | label: $localize`Delete WebTorrent files`, | 112 | label: $localize`Delete WebTorrent files`, |
100 | handler: videos => this.removeVideoFiles(videos, 'webtorrent'), | 113 | handler: videos => this.removeVideoFiles(videos, 'webtorrent'), |
101 | isDisplayed: videos => this.authUser.hasRight(UserRight.MANAGE_VIDEO_FILES) && videos.every(v => v.hasHLS() && v.hasWebTorrent()), | 114 | isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)), |
102 | iconName: 'delete' | 115 | iconName: 'delete' |
103 | } | 116 | } |
104 | ] | 117 | ] |
@@ -226,4 +239,17 @@ export class VideoListComponent extends RestTable implements OnInit { | |||
226 | error: err => this.notifier.error(err.message) | 239 | error: err => this.notifier.error(err.message) |
227 | }) | 240 | }) |
228 | } | 241 | } |
242 | |||
243 | private runTranscoding (videos: Video[], type: 'hls' | 'webtorrent') { | ||
244 | this.videoService.runTranscoding(videos.map(v => v.id), type) | ||
245 | .subscribe({ | ||
246 | next: () => { | ||
247 | this.notifier.success($localize`Transcoding jobs created.`) | ||
248 | |||
249 | this.reloadData() | ||
250 | }, | ||
251 | |||
252 | error: err => this.notifier.error(err.message) | ||
253 | }) | ||
254 | } | ||
229 | } | 255 | } |