]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-edit/shared/video-edit.component.ts
Revert matrix for docker build
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / shared / video-edit.component.ts
index 0275f66f5db0d98d02921f092fb86b5e8ff1240f..89687f35eec11c3c8661c9312ffcb74f417cc3c3 100644 (file)
@@ -22,6 +22,8 @@ import {
 import { FormReactiveValidationMessages, FormValidatorService } from '@app/shared/shared-forms'
 import { InstanceService } from '@app/shared/shared-instance'
 import { VideoCaptionEdit, VideoCaptionWithPathEdit, VideoEdit, VideoService } from '@app/shared/shared-main'
+import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
+import { logger } from '@root-helpers/logger'
 import { PluginInfo } from '@root-helpers/plugins-manager'
 import {
   HTMLServerConfig,
@@ -33,13 +35,11 @@ import {
   VideoDetails,
   VideoPrivacy
 } from '@shared/models'
+import { VideoSource } from '@shared/models/videos/video-source'
 import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service'
 import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
 import { VideoCaptionEditModalContentComponent } from './video-caption-edit-modal-content/video-caption-edit-modal-content.component'
 import { VideoEditType } from './video-edit.type'
-import { VideoSource } from '@shared/models/videos/video-source'
-import { logger } from '@root-helpers/logger'
-import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
 
 type VideoLanguages = VideoConstant<string> & { group?: string }
 type PluginField = {
@@ -66,7 +66,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
   @Input() videoCaptions: VideoCaptionWithPathEdit[] = []
   @Input() videoSource: VideoSource
 
-  @Input() waitTranscodingEnabled = true
+  @Input() hideWaitTranscoding = false
+
   @Input() type: VideoEditType
   @Input() liveVideo: LiveVideo
 
@@ -140,7 +141,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
       nsfw: 'false',
       commentsEnabled: this.serverConfig.defaults.publish.commentsEnabled,
       downloadEnabled: this.serverConfig.defaults.publish.downloadEnabled,
-      waitTranscoding: 'true',
+      waitTranscoding: true,
       licence: this.serverConfig.defaults.publish.licence,
       tags: []
     }
@@ -239,7 +240,15 @@ export class VideoEditComponent implements OnInit, OnDestroy {
       this.schedulerInterval = setInterval(() => this.minScheduledDate = new Date(), 1000 * 60) // Update every minute
     })
 
-    this.hooks.runAction('action:video-edit.init', 'video-edit', { type: this.type })
+    const updateFormForPlugins = (values: any) => {
+      this.form.patchValue(values)
+      this.cd.detectChanges()
+    }
+    this.hooks.runAction('action:video-edit.init', 'video-edit', { type: this.type, updateForm: updateFormForPlugins })
+
+    this.form.valueChanges.subscribe(() => {
+      this.hooks.runAction('action:video-edit.form.updated', 'video-edit', { type: this.type, formValues: this.form.value })
+    })
   }
 
   ngOnDestroy () {
@@ -346,6 +355,9 @@ export class VideoEditComponent implements OnInit, OnDestroy {
     for (const setting of this.pluginFields) {
       await this.pluginService.translateSetting(setting.pluginInfo.plugin.npmName, setting.commonOptions)
 
+      // Not a form input, just a HTML tag
+      if (setting.commonOptions.type === 'html') continue
+
       const validator = async (control: AbstractControl) => {
         if (!setting.commonOptions.error) return null