]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/+video-edit/shared/video-edit.component.ts
Merge branch 'develop' into pr/1285
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-edit / shared / video-edit.component.ts
index 1dae931e2bb270139c33d7a52e085413e2f75988..83645294846dc97df1ee678a965cdc569a710d2e 100644 (file)
@@ -2,7 +2,7 @@ import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
 import { FormArray, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'
 import { ActivatedRoute, Router } from '@angular/router'
 import { FormReactiveValidationMessages, VideoValidatorsService } from '@app/shared'
-import { NotificationsService } from 'angular2-notifications'
+import { Notifier } from '@app/core'
 import { ServerService } from '../../../core/server'
 import { VideoEdit } from '../../../shared/video/video-edit.model'
 import { map } from 'rxjs/operators'
@@ -27,6 +27,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
   @Input() userVideoChannels: { id: number, label: string, support: string }[] = []
   @Input() schedulePublicationPossible = true
   @Input() videoCaptions: VideoCaptionEdit[] = []
+  @Input() waitTranscodingEnabled = true
 
   @ViewChild('videoCaptionAddModal') videoCaptionAddModal: VideoCaptionAddModalComponent
 
@@ -44,11 +45,12 @@ export class VideoEditComponent implements OnInit, OnDestroy {
 
   calendarLocale: any = {}
   minScheduledDate = new Date()
+  myYearRange = '1880:' + (new Date()).getFullYear()
 
   calendarTimezone: string
   calendarDateFormat: string
 
-  private schedulerInterval
+  private schedulerInterval: any
   private firstPatchDone = false
   private initialVideoCaptions: string[] = []
 
@@ -58,7 +60,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
     private videoCaptionService: VideoCaptionService,
     private route: ActivatedRoute,
     private router: Router,
-    private notificationsService: NotificationsService,
+    private notifier: Notifier,
     private serverService: ServerService,
     private i18nPrimengCalendarService: I18nPrimengCalendarService
   ) {
@@ -77,14 +79,14 @@ export class VideoEditComponent implements OnInit, OnDestroy {
   }
 
   updateForm () {
-    const defaultValues = {
+    const defaultValues: any = {
       nsfw: 'false',
       commentsEnabled: 'true',
       downloadEnabled: 'true',
       waitTranscoding: 'true',
       tags: []
     }
-    const obj = {
+    const obj: any = {
       name: this.videoValidatorsService.VIDEO_NAME,
       privacy: this.videoValidatorsService.VIDEO_PRIVACY,
       channelId: this.videoValidatorsService.VIDEO_CHANNEL,
@@ -100,7 +102,8 @@ export class VideoEditComponent implements OnInit, OnDestroy {
       thumbnailfile: null,
       previewfile: null,
       support: this.videoValidatorsService.VIDEO_SUPPORT,
-      schedulePublicationAt: this.videoValidatorsService.VIDEO_SCHEDULE_PUBLICATION_AT
+      schedulePublicationAt: this.videoValidatorsService.VIDEO_SCHEDULE_PUBLICATION_AT,
+      originallyPublishedAt: this.videoValidatorsService.VIDEO_ORIGINALLY_PUBLISHED_AT
     }
 
     this.formValidatorService.updateForm(