]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-edit/video-update.component.ts
Add ability to set a public to private in client
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-edit / video-update.component.ts
index 9e849014ed5fd688dfd9c22fb7b7a0f94de893dc..e990ceb137c460e145a6da96bba47db19fbb9dd4 100644 (file)
@@ -3,7 +3,6 @@ import { Component, HostListener, OnInit } from '@angular/core'
 import { ActivatedRoute, Router } from '@angular/router'
 import { LoadingBarService } from '@ngx-loading-bar/core'
 import { Notifier } from '@app/core'
-import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos'
 import { ServerService } from '../../core'
 import { FormReactive } from '../../shared'
 import { VideoEdit } from '../../shared/video/video-edit.model'
@@ -23,7 +22,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
   video: VideoEdit
 
   isUpdatingVideo = false
-  videoPrivacies: VideoConstant<VideoPrivacy>[] = []
   userVideoChannels: { id: number, label: string, support: string }[] = []
   schedulePublicationPossible = false
   videoCaptions: VideoCaptionEdit[] = []
@@ -48,9 +46,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
   ngOnInit () {
     this.buildForm({})
 
-    this.serverService.videoPrivaciesLoaded
-        .subscribe(() => this.videoPrivacies = this.serverService.getVideoPrivacies())
-
     this.route.data
         .pipe(map(data => data.videoData))
         .subscribe(({ video, videoChannels, videoCaptions }) => {
@@ -58,15 +53,6 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
           this.userVideoChannels = videoChannels
           this.videoCaptions = videoCaptions
 
-          // 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)
-          } else { // We can schedule video publication only if it it is private
-            this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
-          }
-
-          this.videoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies)
-
           const videoFiles = (video as VideoDetails).files
           if (videoFiles.length > 1) { // Already transcoded
             this.waitTranscodingEnabled = false