]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-edit/shared/video-edit.component.ts
Display latest uploaded date for captions
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / shared / video-edit.component.ts
index a2399eafb90236be03d73d442b7be646cdcaaf84..99f8c9034915c33cb8dcdcc49b2623da55929216 100644 (file)
@@ -37,6 +37,8 @@ import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service'
 import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component'
 import { VideoCaptionEditModalComponent } from './video-caption-edit-modal/video-caption-edit-modal.component'
 import { VideoEditType } from './video-edit.type'
+import { VideoSource } from '@shared/models/videos/video-source'
+import { logger } from '@root-helpers/logger'
 
 type VideoLanguages = VideoConstant<string> & { group?: string }
 type PluginField = {
@@ -61,6 +63,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
   @Input() forbidScheduledPublication = true
 
   @Input() videoCaptions: VideoCaptionWithPathEdit[] = []
+  @Input() videoSource: VideoSource
 
   @Input() waitTranscodingEnabled = true
   @Input() type: VideoEditType
@@ -180,7 +183,6 @@ export class VideoEditComponent implements OnInit, OnDestroy {
 
     this.trackChannelChange()
     this.trackPrivacyChange()
-    this.trackLivePermanentFieldChange()
 
     this.formBuilt.emit()
   }
@@ -442,7 +444,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
 
             const oldChannel = this.userVideoChannels.find(c => c.id === oldChannelId)
             if (!newChannel || !oldChannel) {
-              console.error('Cannot find new or old channel.')
+              logger.error('Cannot find new or old channel.')
               return
             }
 
@@ -457,24 +459,6 @@ export class VideoEditComponent implements OnInit, OnDestroy {
       )
   }
 
-  private trackLivePermanentFieldChange () {
-    // We will update the "support" field depending on the channel
-    this.form.controls['permanentLive']
-      .valueChanges
-      .subscribe(
-        permanentLive => {
-          const saveReplayControl = this.form.controls['saveReplay']
-
-          if (permanentLive === true) {
-            saveReplayControl.setValue(false)
-            saveReplayControl.disable()
-          } else {
-            saveReplayControl.enable()
-          }
-        }
-      )
-  }
-
   private updateSupportField (support: string) {
     return this.form.patchValue({ support: support || '' })
   }