X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Badmin%2Foverview%2Fvideos%2Fvideo-list.component.ts;h=4aed5221b394fac3e363bee798fbec2782b9f3ca;hb=ad5db1044c8599eaaaa2a578b350777ae996b068;hp=3c21adb44c8dd8bc346aff8b4cce4cd1ec7927cc;hpb=b46cf4b920984492df598c1b61179acfc7f6f22e;p=github%2FChocobozzz%2FPeerTube.git 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 { duplicate: true, mute: true, liveInfo: false, - removeFiles: true + removeFiles: true, + transcoding: true } loading = true @@ -89,16 +90,28 @@ export class VideoListComponent extends RestTable implements OnInit { } ], [ + { + label: $localize`Run HLS transcoding`, + handler: videos => this.runTranscoding(videos, 'hls'), + isDisplayed: videos => videos.every(v => v.canRunTranscoding(this.authUser)), + iconName: 'cog' + }, + { + label: $localize`Run WebTorrent transcoding`, + handler: videos => this.runTranscoding(videos, 'webtorrent'), + isDisplayed: videos => videos.every(v => v.canRunTranscoding(this.authUser)), + iconName: 'cog' + }, { label: $localize`Delete HLS files`, handler: videos => this.removeVideoFiles(videos, 'hls'), - isDisplayed: videos => this.authUser.hasRight(UserRight.MANAGE_VIDEO_FILES) && videos.every(v => v.hasHLS() && v.hasWebTorrent()), + isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)), iconName: 'delete' }, { label: $localize`Delete WebTorrent files`, handler: videos => this.removeVideoFiles(videos, 'webtorrent'), - isDisplayed: videos => this.authUser.hasRight(UserRight.MANAGE_VIDEO_FILES) && videos.every(v => v.hasHLS() && v.hasWebTorrent()), + isDisplayed: videos => videos.every(v => v.canRemoveFiles(this.authUser)), iconName: 'delete' } ] @@ -226,4 +239,17 @@ export class VideoListComponent extends RestTable implements OnInit { error: err => this.notifier.error(err.message) }) } + + private runTranscoding (videos: Video[], type: 'hls' | 'webtorrent') { + this.videoService.runTranscoding(videos.map(v => v.id), type) + .subscribe({ + next: () => { + this.notifier.success($localize`Transcoding jobs created.`) + + this.reloadData() + }, + + error: err => this.notifier.error(err.message) + }) + } }