diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-29 14:50:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-01 14:55:10 +0200 |
commit | 1bb4c9ab2e8b3b3022351b33a82a5e527fa5d4d7 (patch) | |
tree | a6554ee0a3ccc2ae402665b2ecf57bb38fd0ed72 /client/src/app/+admin/overview/videos/video-list.component.ts | |
parent | 12d84abeca4917d2f1e3f308010bfcd56d37cb7c (diff) | |
download | PeerTube-1bb4c9ab2e8b3b3022351b33a82a5e527fa5d4d7.tar.gz PeerTube-1bb4c9ab2e8b3b3022351b33a82a5e527fa5d4d7.tar.zst PeerTube-1bb4c9ab2e8b3b3022351b33a82a5e527fa5d4d7.zip |
Add ability to delete a specific video file
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 }, |