X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-edit%2Fvideo-update.component.ts;h=30390ac058ef23836a9a2f420e6c0bdaa407d383;hb=d6e32a2e91c090ed342eaf0709caac2630a67ff3;hp=141ed3522a483ecdeb175abe4a91415989920213;hpb=a685e25ca05f08ad1b3f7fbaccc8744727bd8d27;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/+video-edit/video-update.component.ts b/client/src/app/videos/+video-edit/video-update.component.ts index 141ed3522..30390ac05 100644 --- a/client/src/app/videos/+video-edit/video-update.component.ts +++ b/client/src/app/videos/+video-edit/video-update.component.ts @@ -1,10 +1,10 @@ -import { Component, ElementRef, OnInit } from '@angular/core' +import { Component, OnInit } from '@angular/core' import { FormBuilder, FormGroup } from '@angular/forms' import { ActivatedRoute, Router } from '@angular/router' import { NotificationsService } from 'angular2-notifications' -import { AuthService } from '../../core' +import { ServerService } from '../../core' import { FormReactive, VIDEO_NAME, @@ -14,7 +14,7 @@ import { VIDEO_DESCRIPTION, VIDEO_TAGS } from '../../shared' -import { Video, VideoService } from '../shared' +import { VideoEdit, VideoService } from '../shared' @Component({ selector: 'my-videos-update', @@ -27,7 +27,7 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { videoCategories = [] videoLicences = [] videoLanguages = [] - video: Video + video: VideoEdit tagValidators = VIDEO_TAGS.VALIDATORS tagValidatorsMessages = VIDEO_TAGS.MESSAGES @@ -52,12 +52,11 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { fileError = '' constructor ( - private authService: AuthService, - private elementRef: ElementRef, private formBuilder: FormBuilder, private route: ActivatedRoute, private router: Router, private notificationsService: NotificationsService, + private serverService: ServerService, private videoService: VideoService ) { super() @@ -80,15 +79,15 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { ngOnInit () { this.buildForm() - this.videoCategories = this.videoService.videoCategories - this.videoLicences = this.videoService.videoLicences - this.videoLanguages = this.videoService.videoLanguages + this.videoCategories = this.serverService.getVideoCategories() + this.videoLicences = this.serverService.getVideoLicences() + this.videoLanguages = this.serverService.getVideoLanguages() const uuid: string = this.route.snapshot.params['uuid'] this.videoService.getVideo(uuid) .subscribe( video => { - this.video = video + this.video = new VideoEdit(video) this.hydrateFormFromVideo() },