aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-22 16:54:08 +0100
committerChocobozzz <me@florianbigard.com>2018-02-22 16:54:08 +0100
commit81c263c86fe2a030f09e942e118551727f145b6d (patch)
tree06b2733201e018d7c06644621a0dfa5db9e06a7e /client/src/app
parenta9ca764e7e23c0c14949c308a9ce54d4fdb9a361 (diff)
downloadPeerTube-81c263c86fe2a030f09e942e118551727f145b6d.tar.gz
PeerTube-81c263c86fe2a030f09e942e118551727f145b6d.tar.zst
PeerTube-81c263c86fe2a030f09e942e118551727f145b6d.zip
Add limit to video sizes
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/client/src/app/videos/+video-edit/video-add.component.ts b/client/src/app/videos/+video-edit/video-add.component.ts
index e81243d3e..324f26983 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -133,9 +133,15 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
133 } 133 }
134 134
135 uploadFirstStep () { 135 uploadFirstStep () {
136 const videofile = this.videofileInput.nativeElement.files[0] 136 const videofile = this.videofileInput.nativeElement.files[0] as File
137 if (!videofile) return 137 if (!videofile) return
138 138
139 // Cannot upload videos > 4GB for now
140 if (videofile.size > 4 * 1024 * 1024 * 1024) {
141 this.notificationsService.error('Error', 'We are sorry but PeerTube cannot handle videos > 4GB')
142 return
143 }
144
139 const videoQuota = this.authService.getUser().videoQuota 145 const videoQuota = this.authService.getUser().videoQuota
140 if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) { 146 if (videoQuota !== -1 && (this.userVideoQuotaUsed + videofile.size) > videoQuota) {
141 const bytePipes = new BytesPipe() 147 const bytePipes = new BytesPipe()