From 419b520ca4434d17f3505013174e195c3a316716 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Jan 2022 14:23:00 +0100 Subject: Add ability to cancel & delete video imports --- .../src/app/shared/shared-main/buttons/button.component.html | 4 ++-- client/src/app/shared/shared-main/buttons/button.component.ts | 4 ---- .../app/shared/shared-main/buttons/delete-button.component.ts | 4 ---- .../src/app/shared/shared-main/video/video-import.service.ts | 10 ++++++++++ 4 files changed, 12 insertions(+), 10 deletions(-) (limited to 'client/src/app/shared') diff --git a/client/src/app/shared/shared-main/buttons/button.component.html b/client/src/app/shared/shared-main/buttons/button.component.html index 65e06f7a4..11c8ffedd 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.html +++ b/client/src/app/shared/shared-main/buttons/button.component.html @@ -1,5 +1,5 @@ - - + + {{ label }} diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts index ee74b3d12..b97012d9a 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.ts +++ b/client/src/app/shared/shared-main/buttons/button.component.ts @@ -16,10 +16,6 @@ export class ButtonComponent { @Input() disabled = false @Input() responsiveLabel = false - getTitle () { - return this.title || this.label - } - getClasses () { return { [this.className]: true, diff --git a/client/src/app/shared/shared-main/buttons/delete-button.component.ts b/client/src/app/shared/shared-main/buttons/delete-button.component.ts index c091f5309..90735852c 100644 --- a/client/src/app/shared/shared-main/buttons/delete-button.component.ts +++ b/client/src/app/shared/shared-main/buttons/delete-button.component.ts @@ -20,10 +20,6 @@ export class DeleteButtonComponent implements OnInit { // Use default label if (this.label === '') { this.label = $localize`Delete` - - if (!this.title) { - this.title = this.label - } } } } diff --git a/client/src/app/shared/shared-main/video/video-import.service.ts b/client/src/app/shared/shared-main/video/video-import.service.ts index 99df78e3a..0a610ab1f 100644 --- a/client/src/app/shared/shared-main/video/video-import.service.ts +++ b/client/src/app/shared/shared-main/video/video-import.service.ts @@ -56,6 +56,16 @@ export class VideoImportService { ) } + deleteVideoImport (videoImport: VideoImport) { + return this.authHttp.delete(VideoImportService.BASE_VIDEO_IMPORT_URL + videoImport.id) + .pipe(catchError(err => this.restExtractor.handleError(err))) + } + + cancelVideoImport (videoImport: VideoImport) { + return this.authHttp.post(VideoImportService.BASE_VIDEO_IMPORT_URL + videoImport.id + '/cancel', {}) + .pipe(catchError(err => this.restExtractor.handleError(err))) + } + private buildImportVideoObject (video: VideoUpdate): VideoImportCreate { const language = video.language || null const licence = video.licence || null -- cgit v1.2.3