X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-edit%2Fshared%2Fvideo-edit.component.ts;h=366c93a7936ac26d22185675e6ee31372df18308;hb=9df52d660feb722404be00a50f3c8a612bec1c15;hp=3d916dbce933441c521d707502eac9d3e3f3228c;hpb=5b1a6d45b5d6e50102e1c7c8c845401b76b11b4d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts index 3d916dbce..366c93a79 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts @@ -22,10 +22,10 @@ import { FormReactiveValidationMessages, FormValidatorService } from '@app/share import { InstanceService } from '@app/shared/shared-instance' import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' import { + HTMLServerConfig, LiveVideo, RegisterClientFormFieldOptions, RegisterClientVideoFieldOptions, - ServerConfig, VideoConstant, VideoDetails, VideoPrivacy @@ -84,7 +84,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { calendarTimezone: string calendarDateFormat: string - serverConfig: ServerConfig + serverConfig: HTMLServerConfig pluginFields: PluginField[] = [] @@ -184,7 +184,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { this.serverService.getVideoPrivacies() .subscribe(privacies => { - this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies) + this.videoPrivacies = this.videoService.explainedPrivacyLabels(privacies).videoPrivacies + if (this.schedulePublicationPossible) { this.videoPrivacies.push({ id: this.SPECIAL_SCHEDULED_PRIVACY, @@ -194,9 +195,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { } }) - this.serverConfig = this.serverService.getTmpConfig() - this.serverService.getConfig() - .subscribe(config => this.serverConfig = config) + this.serverConfig = this.serverService.getHTMLConfig() this.initialVideoCaptions = this.videoCaptions.map(c => c.language.id) @@ -234,7 +233,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { async deleteCaption (caption: VideoCaptionEdit) { // Caption recovers his former state - if (caption.action && this.initialVideoCaptions.indexOf(caption.language.id) !== -1) { + if (caption.action && this.initialVideoCaptions.includes(caption.language.id)) { caption.action = undefined return } @@ -298,7 +297,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { private trackPrivacyChange () { // We will update the schedule input and the wait transcoding checkbox validators - this.form.controls[ 'privacy' ] + this.form.controls['privacy'] .valueChanges .pipe(map(res => parseInt(res.toString(), 10))) .subscribe( @@ -337,12 +336,12 @@ export class VideoEditComponent implements OnInit, OnDestroy { private trackChannelChange () { // We will update the "support" field depending on the channel - this.form.controls[ 'channelId' ] + this.form.controls['channelId'] .valueChanges .pipe(map(res => parseInt(res.toString(), 10))) .subscribe( newChannelId => { - const oldChannelId = parseInt(this.form.value[ 'channelId' ], 10) + const oldChannelId = parseInt(this.form.value['channelId'], 10) // Not initialized yet if (isNaN(newChannelId)) return @@ -351,7 +350,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { // Wait support field update setTimeout(() => { - const currentSupport = this.form.value[ 'support' ] + const currentSupport = this.form.value['support'] // First time we set the channel? if (isNaN(oldChannelId)) {