From fc766dd0beeaa54eb27f73e4ec0bbe4913220fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Skyler=20M=C3=A4ntysaari?= Date: Thu, 9 Feb 2023 23:42:10 +0200 Subject: [PATCH] Removed the getMimeType function on server as shouldn't be needed anymore. --- .../apps/immich/src/config/asset-upload.config.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/server/apps/immich/src/config/asset-upload.config.ts b/server/apps/immich/src/config/asset-upload.config.ts index 9d99e7a620..2e1faf4e40 100644 --- a/server/apps/immich/src/config/asset-upload.config.ts +++ b/server/apps/immich/src/config/asset-upload.config.ts @@ -48,23 +48,10 @@ export const multerUtils = { fileFilter, filename, destination }; const logger = new Logger('AssetUploadConfig'); -function getMimeType(file: Express.Multer.File) { - const extension = file.originalname.split('.').pop() as string; - switch (extension.toLowerCase()) { - case 'raf': - return 'image/x-fuji-raf'; - case 'srw': - return 'image/x-samsung-srw'; - default: - return file.mimetype; - } -} - function fileFilter(req: Request, file: any, cb: any) { if (!req.user || (req.user.isPublicUser && !req.user.isAllowUpload)) { return cb(new UnauthorizedException()); } - file.mimetype = getMimeType(file); if ( file.mimetype.match( /\/(jpg|jpeg|png|gif|mp4|webm|x-msvideo|quicktime|heic|heif|dng|x-adobe-dng|webp|tiff|3gpp|nef|x-nikon-nef|x-fuji-raf|x-samsung-srw)$/,