diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-19 14:23:00 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-19 14:31:05 +0100 |
commit | 419b520ca4434d17f3505013174e195c3a316716 (patch) | |
tree | 24dbf663c4e11e970cb780f96e6eb3efe023b222 /client/src/app/+my-library/my-video-imports/my-video-imports.component.ts | |
parent | 52435e467a0b30175a10af1dd3ae10d7d564d8ae (diff) | |
download | PeerTube-419b520ca4434d17f3505013174e195c3a316716.tar.gz PeerTube-419b520ca4434d17f3505013174e195c3a316716.tar.zst PeerTube-419b520ca4434d17f3505013174e195c3a316716.zip |
Add ability to cancel & delete video imports
Diffstat (limited to 'client/src/app/+my-library/my-video-imports/my-video-imports.component.ts')
-rw-r--r-- | client/src/app/+my-library/my-video-imports/my-video-imports.component.ts | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/src/app/+my-library/my-video-imports/my-video-imports.component.ts b/client/src/app/+my-library/my-video-imports/my-video-imports.component.ts index 914785bf7..f01558061 100644 --- a/client/src/app/+my-library/my-video-imports/my-video-imports.component.ts +++ b/client/src/app/+my-library/my-video-imports/my-video-imports.component.ts | |||
@@ -37,6 +37,8 @@ export class MyVideoImportsComponent extends RestTable implements OnInit { | |||
37 | return 'badge-banned' | 37 | return 'badge-banned' |
38 | case VideoImportState.PENDING: | 38 | case VideoImportState.PENDING: |
39 | return 'badge-yellow' | 39 | return 'badge-yellow' |
40 | case VideoImportState.PROCESSING: | ||
41 | return 'badge-blue' | ||
40 | default: | 42 | default: |
41 | return 'badge-green' | 43 | return 'badge-green' |
42 | } | 44 | } |
@@ -54,6 +56,10 @@ export class MyVideoImportsComponent extends RestTable implements OnInit { | |||
54 | return videoImport.state.id === VideoImportState.FAILED | 56 | return videoImport.state.id === VideoImportState.FAILED |
55 | } | 57 | } |
56 | 58 | ||
59 | isVideoImportCancelled (videoImport: VideoImport) { | ||
60 | return videoImport.state.id === VideoImportState.CANCELLED | ||
61 | } | ||
62 | |||
57 | getVideoUrl (video: { uuid: string }) { | 63 | getVideoUrl (video: { uuid: string }) { |
58 | return Video.buildWatchUrl(video) | 64 | return Video.buildWatchUrl(video) |
59 | } | 65 | } |
@@ -62,6 +68,24 @@ export class MyVideoImportsComponent extends RestTable implements OnInit { | |||
62 | return Video.buildUpdateUrl(video) | 68 | return Video.buildUpdateUrl(video) |
63 | } | 69 | } |
64 | 70 | ||
71 | deleteImport (videoImport: VideoImport) { | ||
72 | this.videoImportService.deleteVideoImport(videoImport) | ||
73 | .subscribe({ | ||
74 | next: () => this.reloadData(), | ||
75 | |||
76 | error: err => this.notifier.error(err.message) | ||
77 | }) | ||
78 | } | ||
79 | |||
80 | cancelImport (videoImport: VideoImport) { | ||
81 | this.videoImportService.cancelVideoImport(videoImport) | ||
82 | .subscribe({ | ||
83 | next: () => this.reloadData(), | ||
84 | |||
85 | error: err => this.notifier.error(err.message) | ||
86 | }) | ||
87 | } | ||
88 | |||
65 | protected reloadData () { | 89 | protected reloadData () { |
66 | this.videoImportService.getMyVideoImports(this.pagination, this.sort) | 90 | this.videoImportService.getMyVideoImports(this.pagination, this.sort) |
67 | .subscribe({ | 91 | .subscribe({ |