]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Do not display private privacy if the video is not private
authorChocobozzz <me@florianbigard.com>
Mon, 16 Jul 2018 13:24:50 +0000 (15:24 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 16 Jul 2018 13:24:50 +0000 (15:24 +0200)
client/src/app/shared/video-caption/video-caption.service.ts
client/src/app/videos/+video-edit/video-update.component.ts

index 4ae8ebd0a5c89b9e51feba24997715ca65d8eafd..d1444902d1dd6e5dfe1a3c0d4149fbb62f38212b 100644 (file)
@@ -1,7 +1,7 @@
 import { catchError, map } from 'rxjs/operators'
 import { HttpClient } from '@angular/common/http'
 import { Injectable } from '@angular/core'
-import { forkJoin, Observable } from 'rxjs'
+import { forkJoin, Observable, of } from 'rxjs'
 import { ResultList } from '../../../../../shared'
 import { RestExtractor, RestService } from '../rest'
 import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model'
@@ -42,6 +42,8 @@ export class VideoCaptionService {
   }
 
   updateCaptions (videoId: number | string, videoCaptions: VideoCaptionEdit[]) {
+    if (videoCaptions.length === 0) return of(true)
+
     const observables: Observable<any>[] = []
 
     for (const videoCaption of videoCaptions) {
index b678744019fb7c202e13eba54dae976b90cb7d56..72fcc8659a623a20dca39b19837d6ffb97b240d8 100644 (file)
@@ -84,7 +84,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
 
             // We cannot set private a video that was not private
             if (this.video.privacy !== VideoPrivacy.PRIVATE) {
-              this.videoPrivacies = this.videoPrivacies.filter(p => p.id !== VideoPrivacy.PRIVATE)
+              this.videoPrivacies = this.videoPrivacies.filter(p => p.id.toString() !== VideoPrivacy.PRIVATE.toString())
             } else { // We can schedule video publication only if it it is private
               this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
             }