]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+my-account/my-account-video-playlists/my-account-video-playlist-create.component.ts
Add playlist channel validator when playlist is public
[github/Chocobozzz/PeerTube.git] / client / src / app / +my-account / my-account-video-playlists / my-account-video-playlist-create.component.ts
index 61b61e221a82e84329f58c77ee8315cbd5d47f65..87a10961f4b9466c0f969f26e6fea7ac3a45a62e 100644 (file)
@@ -35,13 +35,17 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
 
   ngOnInit () {
     this.buildForm({
-      'display-name': this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DISPLAY_NAME,
+      displayName: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DISPLAY_NAME,
       privacy: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_PRIVACY,
       description: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_DESCRIPTION,
       videoChannelId: this.videoPlaylistValidatorsService.VIDEO_PLAYLIST_CHANNEL_ID,
       thumbnailfile: null
     })
 
+    this.form.get('privacy').valueChanges.subscribe(privacy => {
+      this.videoPlaylistValidatorsService.setChannelValidator(this.form.get('videoChannelId'), privacy)
+    })
+
     populateAsyncUserVideoChannels(this.authService, this.userVideoChannels)
 
     this.serverService.videoPlaylistPrivaciesLoaded.subscribe(
@@ -60,7 +64,7 @@ export class MyAccountVideoPlaylistCreateComponent extends MyAccountVideoPlaylis
 
     const body = this.form.value
     const videoPlaylistCreate: VideoPlaylistCreate = {
-      displayName: body['display-name'],
+      displayName: body.displayName,
       privacy: body.privacy,
       description: body.description || null,
       videoChannelId: body.videoChannelId || null,