aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-edit/video-add-components
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-10-18 14:35:31 +0200
committerChocobozzz <me@florianbigard.com>2018-10-18 14:35:31 +0200
commitc199c427d4ae586339822320f20f512a7a19dc3f (patch)
tree9cbe8bebc25e97d2e8086c41bcd7180dd752dbac /client/src/app/videos/+video-edit/video-add-components
parentcdf4cb9eaf5f6bc71f7c1e1963c07575f1d2593d (diff)
downloadPeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.tar.gz
PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.tar.zst
PeerTube-c199c427d4ae586339822320f20f512a7a19dc3f.zip
Better typings
Diffstat (limited to 'client/src/app/videos/+video-edit/video-add-components')
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts6
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-send.ts6
-rw-r--r--client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts6
3 files changed, 9 insertions, 9 deletions
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
index 9a50e2ab2..e13c06ce9 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
@@ -1,4 +1,4 @@
1import { Component, EventEmitter, OnInit, Output, ViewChild } from '@angular/core' 1import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core'
2import { Router } from '@angular/router' 2import { Router } from '@angular/router'
3import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
4import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos' 4import { VideoPrivacy, VideoUpdate } from '../../../../../../shared/models/videos'
@@ -23,7 +23,7 @@ import { VideoImportService } from '@app/shared/video-import'
23}) 23})
24export class VideoImportTorrentComponent extends VideoSend implements OnInit, CanComponentDeactivate { 24export class VideoImportTorrentComponent extends VideoSend implements OnInit, CanComponentDeactivate {
25 @Output() firstStepDone = new EventEmitter<string>() 25 @Output() firstStepDone = new EventEmitter<string>()
26 @ViewChild('torrentfileInput') torrentfileInput: any 26 @ViewChild('torrentfileInput') torrentfileInput: ElementRef<HTMLInputElement>
27 27
28 videoFileName: string 28 videoFileName: string
29 magnetUri = '' 29 magnetUri = ''
@@ -64,7 +64,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca
64 } 64 }
65 65
66 fileChange () { 66 fileChange () {
67 const torrentfile = this.torrentfileInput.nativeElement.files[0] as File 67 const torrentfile = this.torrentfileInput.nativeElement.files[0]
68 if (!torrentfile) return 68 if (!torrentfile) return
69 69
70 this.importVideo(torrentfile) 70 this.importVideo(torrentfile)
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-send.ts b/client/src/app/videos/+video-edit/video-add-components/video-send.ts
index cf9d47cbe..1bf22e1a9 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-send.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-send.ts
@@ -3,7 +3,6 @@ import { LoadingBarService } from '@ngx-loading-bar/core'
3import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
4import { catchError, switchMap, tap } from 'rxjs/operators' 4import { catchError, switchMap, tap } from 'rxjs/operators'
5import { FormReactive } from '@app/shared' 5import { FormReactive } from '@app/shared'
6import { CanComponentDeactivate } from '@app/shared/guards/can-deactivate-guard.service'
7import { VideoConstant, VideoPrivacy } from '../../../../../../shared' 6import { VideoConstant, VideoPrivacy } from '../../../../../../shared'
8import { AuthService, ServerService } from '@app/core' 7import { AuthService, ServerService } from '@app/core'
9import { VideoService } from '@app/shared/video/video.service' 8import { VideoService } from '@app/shared/video/video.service'
@@ -11,8 +10,9 @@ import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.m
11import { VideoCaptionService } from '@app/shared/video-caption' 10import { VideoCaptionService } from '@app/shared/video-caption'
12import { VideoEdit } from '@app/shared/video/video-edit.model' 11import { VideoEdit } from '@app/shared/video/video-edit.model'
13import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils' 12import { populateAsyncUserVideoChannels } from '@app/shared/misc/utils'
13import { CanComponentDeactivateResult } from '@app/shared/guards/can-deactivate-guard.service'
14 14
15export abstract class VideoSend extends FormReactive implements OnInit, CanComponentDeactivate { 15export abstract class VideoSend extends FormReactive implements OnInit {
16 userVideoChannels: { id: number, label: string, support: string }[] = [] 16 userVideoChannels: { id: number, label: string, support: string }[] = []
17 videoPrivacies: VideoConstant<VideoPrivacy>[] = [] 17 videoPrivacies: VideoConstant<VideoPrivacy>[] = []
18 videoCaptions: VideoCaptionEdit[] = [] 18 videoCaptions: VideoCaptionEdit[] = []
@@ -30,7 +30,7 @@ export abstract class VideoSend extends FormReactive implements OnInit, CanCompo
30 protected videoService: VideoService 30 protected videoService: VideoService
31 protected videoCaptionService: VideoCaptionService 31 protected videoCaptionService: VideoCaptionService
32 32
33 abstract canDeactivate (): any 33 abstract canDeactivate (): CanComponentDeactivateResult
34 34
35 ngOnInit () { 35 ngOnInit () {
36 this.buildForm({}) 36 this.buildForm({})
diff --git a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
index fa6ee0c23..8e2d0deaf 100644
--- a/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
+++ b/client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
@@ -1,5 +1,5 @@
1import { HttpEventType, HttpResponse } from '@angular/common/http' 1import { HttpEventType, HttpResponse } from '@angular/common/http'
2import { Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core' 2import { Component, ElementRef, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
3import { Router } from '@angular/router' 3import { Router } from '@angular/router'
4import { LoadingBarService } from '@ngx-loading-bar/core' 4import { LoadingBarService } from '@ngx-loading-bar/core'
5import { NotificationsService } from 'angular2-notifications' 5import { NotificationsService } from 'angular2-notifications'
@@ -25,7 +25,7 @@ import { VideoCaptionService } from '@app/shared/video-caption'
25}) 25})
26export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate { 26export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy, CanComponentDeactivate {
27 @Output() firstStepDone = new EventEmitter<string>() 27 @Output() firstStepDone = new EventEmitter<string>()
28 @ViewChild('videofileInput') videofileInput: any 28 @ViewChild('videofileInput') videofileInput: ElementRef<HTMLInputElement>
29 29
30 // So that it can be accessed in the template 30 // So that it can be accessed in the template
31 readonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACY 31 readonly SPECIAL_SCHEDULED_PRIVACY = VideoEdit.SPECIAL_SCHEDULED_PRIVACY
@@ -110,7 +110,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
110 } 110 }
111 111
112 uploadFirstStep () { 112 uploadFirstStep () {
113 const videofile = this.videofileInput.nativeElement.files[0] as File 113 const videofile = this.videofileInput.nativeElement.files[0]
114 if (!videofile) return 114 if (!videofile) return
115 115
116 // Cannot upload videos > 8GB for now 116 // Cannot upload videos > 8GB for now