diff options
Diffstat (limited to 'client/src/app/shared/shared-main/video-caption/video-caption.service.ts')
-rw-r--r-- | client/src/app/shared/shared-main/video-caption/video-caption.service.ts | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/client/src/app/shared/shared-main/video-caption/video-caption.service.ts b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts index 29d6d0f4c..97b79d842 100644 --- a/client/src/app/shared/shared-main/video-caption/video-caption.service.ts +++ b/client/src/app/shared/shared-main/video-caption/video-caption.service.ts | |||
@@ -42,10 +42,7 @@ export class VideoCaptionService { | |||
42 | 42 | ||
43 | removeCaption (videoId: number | string, language: string) { | 43 | removeCaption (videoId: number | string, language: string) { |
44 | return this.authHttp.delete(`${VideoService.BASE_VIDEO_URL}/${videoId}/captions/${language}`) | 44 | return this.authHttp.delete(`${VideoService.BASE_VIDEO_URL}/${videoId}/captions/${language}`) |
45 | .pipe( | 45 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
46 | map(this.restExtractor.extractDataBool), | ||
47 | catchError(res => this.restExtractor.handleError(res)) | ||
48 | ) | ||
49 | } | 46 | } |
50 | 47 | ||
51 | addCaption (videoId: number | string, language: string, captionfile: File) { | 48 | addCaption (videoId: number | string, language: string, captionfile: File) { |
@@ -53,14 +50,11 @@ export class VideoCaptionService { | |||
53 | const data = objectToFormData(body) | 50 | const data = objectToFormData(body) |
54 | 51 | ||
55 | return this.authHttp.put(`${VideoService.BASE_VIDEO_URL}/${videoId}/captions/${language}`, data) | 52 | return this.authHttp.put(`${VideoService.BASE_VIDEO_URL}/${videoId}/captions/${language}`, data) |
56 | .pipe( | 53 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
57 | map(this.restExtractor.extractDataBool), | ||
58 | catchError(res => this.restExtractor.handleError(res)) | ||
59 | ) | ||
60 | } | 54 | } |
61 | 55 | ||
62 | updateCaptions (videoId: number | string, videoCaptions: VideoCaptionEdit[]) { | 56 | updateCaptions (videoId: number | string, videoCaptions: VideoCaptionEdit[]) { |
63 | let obs = of(true) | 57 | let obs: Observable<any> = of(undefined) |
64 | 58 | ||
65 | for (const videoCaption of videoCaptions) { | 59 | for (const videoCaption of videoCaptions) { |
66 | if (videoCaption.action === 'CREATE') { | 60 | if (videoCaption.action === 'CREATE') { |