]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-edit/video-add-components/video-send.ts
Merge branch 'constant-registry' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / video-add-components / video-send.ts
index a185892fe36d1ce6d10f461a52149c9276f1afc8..ce8de049d85d0b5a51c755ee36c76b3da758434c 100644 (file)
@@ -15,21 +15,24 @@ export abstract class VideoSend extends FormReactive implements OnInit {
   videoPrivacies: VideoConstant<VideoPrivacy>[] = []
   videoCaptions: VideoCaptionEdit[] = []
 
-  firstStepPrivacyId = 0
-  firstStepChannelId = 0
+  firstStepPrivacyId: VideoPrivacy
+  firstStepChannelId: number
 
   abstract firstStepDone: EventEmitter<string>
   abstract firstStepError: EventEmitter<void>
-  protected abstract readonly DEFAULT_VIDEO_PRIVACY: VideoPrivacy
 
   protected loadingBar: LoadingBarService
   protected notifier: Notifier
   protected authService: AuthService
+
   protected serverService: ServerService
   protected videoService: VideoService
   protected videoCaptionService: VideoCaptionService
+
   protected serverConfig: HTMLServerConfig
 
+  protected highestPrivacy: VideoPrivacy
+
   abstract canDeactivate (): CanComponentDeactivateResult
 
   ngOnInit () {
@@ -46,9 +49,12 @@ export abstract class VideoSend extends FormReactive implements OnInit {
     this.serverService.getVideoPrivacies()
         .subscribe(
           privacies => {
-            this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies)
+            const { videoPrivacies, defaultPrivacyId } = this.videoService.explainedPrivacyLabels(privacies)
+
+            this.videoPrivacies = videoPrivacies
+            this.firstStepPrivacyId = defaultPrivacyId
 
-            this.firstStepPrivacyId = this.DEFAULT_VIDEO_PRIVACY
+            this.highestPrivacy = this.videoService.getHighestAvailablePrivacy(privacies)
           })
   }