]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-edit/shared/video-caption-add-modal.component.ts
Fix lint
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-edit / shared / video-caption-add-modal.component.ts
index 98d66ff00db633afd7afec111a144b3342a11f13..4ab2d42db2294c07309472efd84214bdecd5d35f 100644 (file)
@@ -1,7 +1,7 @@
 import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core'
 import { ServerService } from '@app/core'
 import { VIDEO_CAPTION_FILE_VALIDATOR, VIDEO_CAPTION_LANGUAGE_VALIDATOR } from '@app/shared/form-validators/video-captions-validators'
-import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
+import { FormReactive, FormReactiveService } from '@app/shared/shared-forms'
 import { VideoCaptionEdit } from '@app/shared/shared-main'
 import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'
 import { HTMLServerConfig, VideoConstant } from '@shared/models'
@@ -26,7 +26,7 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
   private closingModal = false
 
   constructor (
-    protected formValidatorService: FormValidatorService,
+    protected formReactiveService: FormReactiveService,
     private modalService: NgbModal,
     private serverService: ServerService
   ) {
@@ -41,6 +41,10 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
     return this.serverConfig.videoCaption.file.size.max
   }
 
+  getReactiveFileButtonTooltip () {
+    return `(extensions: ${this.videoCaptionExtensions.join(', ')})`
+  }
+
   ngOnInit () {
     this.serverService.getVideoLanguages()
         .subscribe(languages => this.videoCaptionLanguages = languages)
@@ -71,13 +75,14 @@ export class VideoCaptionAddModalComponent extends FormReactive implements OnIni
     return languageId && this.existingCaptions.includes(languageId)
   }
 
-  async addCaption () {
+  addCaption () {
     const languageId = this.form.value['language']
     const languageObject = this.videoCaptionLanguages.find(l => l.id === languageId)
 
     this.captionAdded.emit({
       language: languageObject,
-      captionfile: this.form.value['captionfile']
+      captionfile: this.form.value['captionfile'],
+      action: 'CREATE'
     })
 
     this.hide()