]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Don't break video scheduled publication
authorChocobozzz <me@florianbigard.com>
Fri, 7 Jun 2019 13:37:36 +0000 (15:37 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 7 Jun 2019 13:37:36 +0000 (15:37 +0200)
client/src/app/core/server/server.service.ts
client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts
client/src/app/videos/+video-edit/video-update.component.ts

index 3a8a535fd4ae4e6ba47d5fd5f9752e6468cb006e..689f25a405c980415a3adbd67c28f9d52841dd5e 100644 (file)
@@ -10,6 +10,7 @@ import { isDefaultLocale, peertubeTranslate } from '../../../../../shared/models
 import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
 import { sortBy } from '@app/shared/misc/utils'
 import { VideoPlaylistPrivacy } from '@shared/models/videos/playlist/video-playlist-privacy.model'
+import { cloneDeep } from 'lodash-es'
 
 @Injectable()
 export class ServerService {
@@ -160,27 +161,27 @@ export class ServerService {
   }
 
   getConfig () {
-    return this.config
+    return cloneDeep(this.config)
   }
 
   getVideoCategories () {
-    return this.videoCategories
+    return cloneDeep(this.videoCategories)
   }
 
   getVideoLicences () {
-    return this.videoLicences
+    return cloneDeep(this.videoLicences)
   }
 
   getVideoLanguages () {
-    return this.videoLanguages
+    return cloneDeep(this.videoLanguages)
   }
 
   getVideoPrivacies () {
-    return this.videoPrivacies
+    return cloneDeep(this.videoPrivacies)
   }
 
   getVideoPlaylistPrivacies () {
-    return this.videoPlaylistPrivacies
+    return cloneDeep(this.videoPlaylistPrivacies)
   }
 
   private loadAttributeEnum (
index 2dffdbf0e49c7ab9282fc9fbbec864ef1a850565..a5578bebd76e879718fc347ef658a884be44d8c9 100644 (file)
@@ -91,8 +91,6 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
           previewUrl: null
         }))
 
-        this.explainedVideoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies)
-
         this.hydrateFormFromVideo()
       },
 
index e990ceb137c460e145a6da96bba47db19fbb9dd4..81c66ff209878d42230380bfaf35da34f4e94deb 100644 (file)
@@ -12,6 +12,7 @@ import { FormValidatorService } from '@app/shared/forms/form-validators/form-val
 import { VideoCaptionService } from '@app/shared/video-caption'
 import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
 import { VideoDetails } from '@app/shared/video/video-details.model'
+import { VideoPrivacy } from '@shared/models'
 
 @Component({
   selector: 'my-videos-update',
@@ -53,6 +54,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit {
           this.userVideoChannels = videoChannels
           this.videoCaptions = videoCaptions
 
+          this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
+
           const videoFiles = (video as VideoDetails).files
           if (videoFiles.length > 1) { // Already transcoded
             this.waitTranscodingEnabled = false