From 307902e2b3248073aeb677e420aafd8b5e041117 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 24 Jan 2019 15:23:06 +0100 Subject: [PATCH] Try to fix Mac video upload --- client/src/app/+accounts/accounts.component.ts | 3 +-- server/helpers/custom-validators/videos.ts | 4 ++-- server/initializers/constants.ts | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index 036264602..e8339b78b 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts @@ -26,8 +26,7 @@ export class AccountsComponent implements OnInit, OnDestroy { private notifier: Notifier, private restExtractor: RestExtractor, private redirectService: RedirectService, - private authService: AuthService, - private i18n: I18n + private authService: AuthService ) {} ngOnInit () { diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index e6f22e6c5..95e256b8f 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts @@ -88,8 +88,8 @@ function isVideoFileExtnameValid (value: string) { function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) { const videoFileTypesRegex = Object.keys(MIMETYPES.VIDEO.MIMETYPE_EXT) - .map(m => `(${m})`) - .join('|') + .map(m => `(${m})`) + .join('|') return isFileValid(files, videoFileTypesRegex, 'videofile', null) } diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 93fdd3f03..6f3ebb9aa 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -795,7 +795,9 @@ function buildVideoMimetypeExt () { 'video/quicktime': '.mov', 'video/x-msvideo': '.avi', 'video/x-flv': '.flv', - 'video/x-matroska': '.mkv' + 'video/x-matroska': '.mkv', + 'application/octet-stream': '.mkv', + 'video/avi': '.avi' }) } -- 2.41.0