diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/shared/video-caption/video-caption.service.ts | 4 | ||||
-rw-r--r-- | client/src/app/videos/+video-edit/video-update.component.ts | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/client/src/app/shared/video-caption/video-caption.service.ts b/client/src/app/shared/video-caption/video-caption.service.ts index 4ae8ebd0a..d1444902d 100644 --- a/client/src/app/shared/video-caption/video-caption.service.ts +++ b/client/src/app/shared/video-caption/video-caption.service.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { catchError, map } from 'rxjs/operators' | 1 | import { catchError, map } from 'rxjs/operators' |
2 | import { HttpClient } from '@angular/common/http' | 2 | import { HttpClient } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { forkJoin, Observable } from 'rxjs' | 4 | import { forkJoin, Observable, of } from 'rxjs' |
5 | import { ResultList } from '../../../../../shared' | 5 | import { ResultList } from '../../../../../shared' |
6 | import { RestExtractor, RestService } from '../rest' | 6 | import { RestExtractor, RestService } from '../rest' |
7 | import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model' | 7 | import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model' |
@@ -42,6 +42,8 @@ export class VideoCaptionService { | |||
42 | } | 42 | } |
43 | 43 | ||
44 | updateCaptions (videoId: number | string, videoCaptions: VideoCaptionEdit[]) { | 44 | updateCaptions (videoId: number | string, videoCaptions: VideoCaptionEdit[]) { |
45 | if (videoCaptions.length === 0) return of(true) | ||
46 | |||
45 | const observables: Observable<any>[] = [] | 47 | const observables: Observable<any>[] = [] |
46 | 48 | ||
47 | for (const videoCaption of videoCaptions) { | 49 | for (const videoCaption of videoCaptions) { |
diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index b67874401..72fcc8659 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts | |||
@@ -84,7 +84,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
84 | 84 | ||
85 | // We cannot set private a video that was not private | 85 | // We cannot set private a video that was not private |
86 | if (this.video.privacy !== VideoPrivacy.PRIVATE) { | 86 | if (this.video.privacy !== VideoPrivacy.PRIVATE) { |
87 | this.videoPrivacies = this.videoPrivacies.filter(p => p.id !== VideoPrivacy.PRIVATE) | 87 | this.videoPrivacies = this.videoPrivacies.filter(p => p.id.toString() !== VideoPrivacy.PRIVATE.toString()) |
88 | } else { // We can schedule video publication only if it it is private | 88 | } else { // We can schedule video publication only if it it is private |
89 | this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE | 89 | this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE |
90 | } | 90 | } |