From 12bec528aafd895075e19486b87b64f0f58581ac Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Jun 2019 15:37:36 +0200 Subject: [PATCH] Don't break video scheduled publication --- client/src/app/core/server/server.service.ts | 13 +++++++------ .../video-import-url.component.ts | 2 -- .../videos/+video-edit/video-update.component.ts | 3 +++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts index 3a8a535fd..689f25a40 100644 --- a/client/src/app/core/server/server.service.ts +++ b/client/src/app/core/server/server.service.ts @@ -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 ( diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts index 2dffdbf0e..a5578bebd 100644 --- a/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts +++ b/client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts @@ -91,8 +91,6 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom previewUrl: null })) - this.explainedVideoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies) - this.hydrateFormFromVideo() }, diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index e990ceb13..81c66ff20 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts @@ -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 -- 2.25.1