aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-03-12 11:29:38 +0100
committerChocobozzz <me@florianbigard.com>2018-03-12 11:44:28 +0100
commitf2c3f7cd8a592ca1949e4f73717f17132a16c292 (patch)
treecb648c2d973075fe2ec15918ef74e50ab279dce4
parentb64c950a1cb37da880fc14e8535f438c78b5b7f7 (diff)
downloadPeerTube-f2c3f7cd8a592ca1949e4f73717f17132a16c292.tar.gz
PeerTube-f2c3f7cd8a592ca1949e4f73717f17132a16c292.tar.zst
PeerTube-f2c3f7cd8a592ca1949e4f73717f17132a16c292.zip
Fix upload with small file names
-rw-r--r--client/src/app/videos/+video-edit/video-add.component.ts11
1 files changed, 10 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 4c9dbf1bb..ae5548897 100644
--- a/client/src/app/videos/+video-edit/video-add.component.ts
+++ b/client/src/app/videos/+video-edit/video-add.component.ts
@@ -156,7 +156,16 @@ export class VideoAddComponent extends FormReactive implements OnInit, OnDestroy
156 156
157 this.videoFileName = videofile.name 157 this.videoFileName = videofile.name
158 158
159 const name = videofile.name.replace(/\.[^/.]+$/, '') 159 const nameWithoutExtension = videofile.name.replace(/\.[^/.]+$/, '')
160 let name: string
161
162 // If the name of the file is very small, keep the extension
163 if (nameWithoutExtension.length < 3) {
164 name = videofile.name
165 } else {
166 name = nameWithoutExtension
167 }
168
160 const privacy = this.firstStepPrivacyId.toString() 169 const privacy = this.firstStepPrivacyId.toString()
161 const nsfw = false 170 const nsfw = false
162 const commentsEnabled = true 171 const commentsEnabled = true