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 | 18 |
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' | |||
8 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' | 8 | import { DropdownAction, Video, VideoService } from '@app/shared/shared-main' |
9 | import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation' | 9 | import { VideoBlockComponent, VideoBlockService } from '@app/shared/shared-moderation' |
10 | import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' | 10 | import { VideoActionsDisplayType } from '@app/shared/shared-video-miniature' |
11 | import { UserRight, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models' | 11 | import { UserRight, VideoFile, VideoPrivacy, VideoState, VideoStreamingPlaylistType } from '@shared/models' |
12 | import { VideoAdminService } from './video-admin.service' | 12 | import { 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 }, |