aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-edit/video-add-components
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-edit/video-add-components')
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/drag-drop.directive.ts8
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.ts4
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-send.ts2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html2
-rw-r--r--client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts5
8 files changed, 15 insertions, 12 deletions
diff --git a/client/src/app/+videos/+video-edit/video-add-components/drag-drop.directive.ts b/client/src/app/+videos/+video-edit/video-add-components/drag-drop.directive.ts
index 7b1a38c62..7c35e6b84 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/drag-drop.directive.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/drag-drop.directive.ts
@@ -1,26 +1,26 @@
1import { Directive, Output, EventEmitter, HostBinding, HostListener } from '@angular/core' 1import { Directive, Output, EventEmitter, HostBinding, HostListener } from '@angular/core'
2 2
3@Directive({ 3@Directive({
4 selector: '[dragDrop]' 4 selector: '[myDragDrop]'
5}) 5})
6export class DragDropDirective { 6export class DragDropDirective {
7 @Output() fileDropped = new EventEmitter<FileList>() 7 @Output() fileDropped = new EventEmitter<FileList>()
8 8
9 @HostBinding('class.dragover') dragover = false 9 @HostBinding('class.dragover') dragover = false
10 10
11 @HostListener('dragover', ['$event']) onDragOver (e: Event) { 11 @HostListener('dragover', [ '$event' ]) onDragOver (e: Event) {
12 e.preventDefault() 12 e.preventDefault()
13 e.stopPropagation() 13 e.stopPropagation()
14 this.dragover = true 14 this.dragover = true
15 } 15 }
16 16
17 @HostListener('dragleave', ['$event']) public onDragLeave (e: Event) { 17 @HostListener('dragleave', [ '$event' ]) public onDragLeave (e: Event) {
18 e.preventDefault() 18 e.preventDefault()
19 e.stopPropagation() 19 e.stopPropagation()
20 this.dragover = false 20 this.dragover = false
21 } 21 }
22 22
23 @HostListener('drop', ['$event']) public ondrop (e: DragEvent) { 23 @HostListener('drop', [ '$event' ]) public ondrop (e: DragEvent) {
24 e.preventDefault() 24 e.preventDefault()
25 e.stopPropagation() 25 e.stopPropagation()
26 this.dragover = false 26 this.dragover = false
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
index 30c79594d..1b9447e03 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts
@@ -41,7 +41,7 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, AfterView
41 private liveVideoService: LiveVideoService, 41 private liveVideoService: LiveVideoService,
42 private router: Router, 42 private router: Router,
43 private hooks: HooksService 43 private hooks: HooksService
44 ) { 44 ) {
45 super() 45 super()
46 } 46 }
47 47
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html
index 20a7538db..0f1a94c84 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-torrent.component.html
@@ -1,4 +1,4 @@
1<div *ngIf="!hasImportedVideo" class="upload-video-container" dragDrop (fileDropped)="setTorrentFile($event)"> 1<div *ngIf="!hasImportedVideo" class="upload-video-container" myDragDrop (fileDropped)="setTorrentFile($event)">
2 <div class="first-step-block"> 2 <div class="first-step-block">
3 <my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon> 3 <my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon>
4 4
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 fef1f5d65..87e47683f 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
@@ -5,7 +5,7 @@ import { scrollToTop } from '@app/helpers'
5import { FormValidatorService } from '@app/shared/shared-forms' 5import { FormValidatorService } from '@app/shared/shared-forms'
6import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main' 6import { VideoCaptionService, VideoEdit, VideoImportService, VideoService } from '@app/shared/shared-main'
7import { LoadingBarService } from '@ngx-loading-bar/core' 7import { LoadingBarService } from '@ngx-loading-bar/core'
8import { PeerTubeProblemDocument, ServerErrorCode, VideoPrivacy, VideoUpdate } from '@shared/models' 8import { PeerTubeProblemDocument, ServerErrorCode, VideoUpdate } from '@shared/models'
9import { hydrateFormFromVideo } from '../shared/video-edit-utils' 9import { hydrateFormFromVideo } from '../shared/video-edit-utils'
10import { VideoSend } from './video-send' 10import { VideoSend } from './video-send'
11 11
@@ -43,7 +43,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Af
43 private router: Router, 43 private router: Router,
44 private videoImportService: VideoImportService, 44 private videoImportService: VideoImportService,
45 private hooks: HooksService 45 private hooks: HooksService
46 ) { 46 ) {
47 super() 47 super()
48 } 48 }
49 49
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
index e1893b28f..3487c1adf 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-import-url.component.ts
@@ -59,7 +59,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, AfterV
59 } 59 }
60 60
61 isTargetUrlValid () { 61 isTargetUrlValid () {
62 return this.targetUrl && this.targetUrl.match(/https?:\/\//) 62 return this.targetUrl?.match(/https?:\/\//)
63 } 63 }
64 64
65 importVideo () { 65 importVideo () {
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 ce8de049d..efa8c85a3 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
@@ -9,7 +9,7 @@ import { LoadingBarService } from '@ngx-loading-bar/core'
9import { HTMLServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' 9import { HTMLServerConfig, VideoConstant, VideoPrivacy } from '@shared/models'
10 10
11@Directive() 11@Directive()
12// tslint:disable-next-line: directive-class-suffix 12// eslint-disable-next-line @angular-eslint/directive-class-suffix
13export abstract class VideoSend extends FormReactive implements OnInit { 13export abstract class VideoSend extends FormReactive implements OnInit {
14 userVideoChannels: SelectChannelItem[] = [] 14 userVideoChannels: SelectChannelItem[] = []
15 videoPrivacies: VideoConstant<VideoPrivacy>[] = [] 15 videoPrivacies: VideoConstant<VideoPrivacy>[] = []
diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
index 14cd06fcf..db494a02f 100644
--- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
+++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.html
@@ -1,4 +1,4 @@
1<div *ngIf="!isUploadingVideo" class="upload-video-container" dragDrop (fileDropped)="onFileDropped($event)"> 1<div *ngIf="!isUploadingVideo" class="upload-video-container" myDragDrop (fileDropped)="onFileDropped($event)">
2 <div class="first-step-block"> 2 <div class="first-step-block">
3 <my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon> 3 <my-global-icon class="upload-icon" iconName="upload" aria-hidden="true"></my-global-icon>
4 4
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 b8cb4fa1e..dee2bb57a 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
@@ -128,7 +128,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
128 128
129 onUploadVideoOngoing (state: UploadState) { 129 onUploadVideoOngoing (state: UploadState) {
130 switch (state.status) { 130 switch (state.status) {
131 case 'error': 131 case 'error': {
132 const error = state.response?.error || 'Unknow error' 132 const error = state.response?.error || 'Unknow error'
133 133
134 this.handleUploadError({ 134 this.handleUploadError({
@@ -143,6 +143,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
143 url: state.url 143 url: state.url
144 }) 144 })
145 break 145 break
146 }
146 147
147 case 'cancelled': 148 case 'cancelled':
148 this.isUploadingVideo = false 149 this.isUploadingVideo = false
@@ -323,6 +324,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
323 const videoQuotaUsedBytes = bytePipes.transform(this.userVideoQuotaUsed, 0) 324 const videoQuotaUsedBytes = bytePipes.transform(this.userVideoQuotaUsed, 0)
324 const videoQuotaBytes = bytePipes.transform(videoQuota, 0) 325 const videoQuotaBytes = bytePipes.transform(videoQuota, 0)
325 326
327 // eslint-disable-next-line max-len
326 const msg = $localize`Your video quota is exceeded with this video (video size: ${videoSizeBytes}, used: ${videoQuotaUsedBytes}, quota: ${videoQuotaBytes})` 328 const msg = $localize`Your video quota is exceeded with this video (video size: ${videoSizeBytes}, used: ${videoQuotaUsedBytes}, quota: ${videoQuotaBytes})`
327 this.notifier.error(msg) 329 this.notifier.error(msg)
328 330
@@ -341,6 +343,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
341 const videoSizeBytes = bytePipes.transform(videofile.size, 0) 343 const videoSizeBytes = bytePipes.transform(videofile.size, 0)
342 const quotaUsedDailyBytes = bytePipes.transform(this.userVideoQuotaUsedDaily, 0) 344 const quotaUsedDailyBytes = bytePipes.transform(this.userVideoQuotaUsedDaily, 0)
343 const quotaDailyBytes = bytePipes.transform(videoQuotaDaily, 0) 345 const quotaDailyBytes = bytePipes.transform(videoQuotaDaily, 0)
346 // eslint-disable-next-line max-len
344 const msg = $localize`Your daily video quota is exceeded with this video (video size: ${videoSizeBytes}, used: ${quotaUsedDailyBytes}, quota: ${quotaDailyBytes})` 347 const msg = $localize`Your daily video quota is exceeded with this video (video size: ${videoSizeBytes}, used: ${quotaUsedDailyBytes}, quota: ${quotaDailyBytes})`
345 this.notifier.error(msg) 348 this.notifier.error(msg)
346 349