aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/overview/videos/video-list.component.ts
diff options
context:
space:
mode:
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.ts18
1 files changed, 17 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 67e52d100..ed7ec54a1 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.ts
+++ b/client/src/app/+admin/overview/videos/video-list.component.ts
@@ -8,7 +8,7 @@ import { AdvancedInputFilter } from '@app/shared/shared-forms'
8import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' 8import { DropdownAction, Video, VideoService } from '@app/shared/shared-main'
9import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation' 9import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation'
10import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' 10import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature'
11import { UserRight, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models' 11import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models'
12import { VideoAdminService } from './video-admin.service' 12import { VideoAdminService } from './video-admin.service'
13 13
14@Component({ 14@Component({
@@ -196,6 +196,22 @@ export class VideoListComponent extends RestTable implements OnInit {
196 }) 196 })
197 } 197 }
198 198
199 async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'webtorrent') {
200 const message = $localize`Are you sure you want to delete this ${file.resolution.label} file?`
201 const res = await this.confirmService.confirm(message, $localize`Delete file`)
202 if (res === false) return
203
204 this.videoService.removeFile(video.uuid, file.id, type)
205 .subscribe({
206 next: () => {
207 this.notifier.success($localize`File removed.`)
208 this.reloadData()
209 },
210
211 error: err => this.notifier.error(err.message)
212 })
213 }
214
199 private async removeVideos (videos: Video[]) { 215 private async removeVideos (videos: Video[]) {
200 const message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`)( 216 const message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`)(
201 { count: videos.length }, 217 { count: videos.length },