diff --git a/README.md b/README.md index 9bddd0837f..62c960eeb3 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,8 @@ This project is under heavy development, there will be continous functions, feat # Features -- Upload and view assets(videos/images). +- Upload and view assets (videos/images). +- Download asset to local device. - Multi-user supported. - Quick navigation with drag scroll bar. - Auto Backup. @@ -58,7 +59,6 @@ This project is under heavy development, there will be continous functions, feat - Image Tagging/Classification based on ImageNet dataset - Object detection based on COCO SSD. - Search assets based on tags and exif data (lens, make, model, orientation) -- Upload assets from your local computer/server using [immich cli tools](https://www.npmjs.com/package/immich) - [Optional] Reverse geocoding using Mapbox (Generous free-tier of 100,000 search/month) - Show asset's location information on map (OpenStreetMap). - Show curated places on the search page diff --git a/mobile/web/favicon.png b/mobile/web/favicon.png deleted file mode 100644 index 8aaa46ac1a..0000000000 Binary files a/mobile/web/favicon.png and /dev/null differ diff --git a/mobile/web/icons/Icon-192.png b/mobile/web/icons/Icon-192.png deleted file mode 100644 index b749bfef07..0000000000 Binary files a/mobile/web/icons/Icon-192.png and /dev/null differ diff --git a/mobile/web/icons/Icon-512.png b/mobile/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48dff..0000000000 Binary files a/mobile/web/icons/Icon-512.png and /dev/null differ diff --git a/mobile/web/icons/Icon-maskable-192.png b/mobile/web/icons/Icon-maskable-192.png deleted file mode 100644 index eb9b4d76e5..0000000000 Binary files a/mobile/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/mobile/web/icons/Icon-maskable-512.png b/mobile/web/icons/Icon-maskable-512.png deleted file mode 100644 index d69c56691f..0000000000 Binary files a/mobile/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/mobile/web/index.html b/mobile/web/index.html deleted file mode 100644 index 3c44166255..0000000000 --- a/mobile/web/index.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - immich_mobile - - - - - - - diff --git a/mobile/web/manifest.json b/mobile/web/manifest.json deleted file mode 100644 index 2cf8c5235a..0000000000 --- a/mobile/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "immich_mobile", - "short_name": "immich_mobile", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/server/src/config/multer-option.config.ts b/server/src/config/multer-option.config.ts index 2d8a87dc9f..fea33e5dc0 100644 --- a/server/src/config/multer-option.config.ts +++ b/server/src/config/multer-option.config.ts @@ -5,10 +5,8 @@ import { diskStorage } from 'multer'; import { extname } from 'path'; import { Request } from 'express'; import { APP_UPLOAD_LOCATION } from '../constants/upload_location.constant'; - -export const multerConfig = { - dest: APP_UPLOAD_LOCATION, -}; +import { randomUUID } from 'crypto'; +import { CreateAssetDto } from '../api-v1/asset/dto/create-asset.dto'; export const multerOption: MulterOptions = { fileFilter: (req: Request, file: any, cb: any) => { @@ -21,7 +19,11 @@ export const multerOption: MulterOptions = { storage: diskStorage({ destination: (req: Request, file: Express.Multer.File, cb: any) => { - const uploadPath = multerConfig.dest; + const uploadPath = APP_UPLOAD_LOCATION; + const fileInfo = req.body as CreateAssetDto; + + const yearInfo = new Date(fileInfo.createdAt).getFullYear(); + const monthInfo = new Date(fileInfo.createdAt).getMonth(); if (file.fieldname == 'assetData') { const originalUploadFolder = `${uploadPath}/${req.user['id']}/original/${req.body['deviceId']}`; @@ -30,6 +32,7 @@ export const multerOption: MulterOptions = { mkdirSync(originalUploadFolder, { recursive: true }); } + // Save original to disk cb(null, originalUploadFolder); } else if (file.fieldname == 'thumbnailData') { const thumbnailUploadFolder = `${uploadPath}/${req.user['id']}/thumb/${req.body['deviceId']}`; @@ -38,17 +41,18 @@ export const multerOption: MulterOptions = { mkdirSync(thumbnailUploadFolder, { recursive: true }); } + // Save thumbnail to disk cb(null, thumbnailUploadFolder); } }, filename: (req: Request, file: Express.Multer.File, cb: any) => { // console.log(req, file); - + const fileNameUUID = randomUUID(); if (file.fieldname == 'assetData') { - cb(null, `${file.originalname.split('.')[0]}${req.body['fileExtension']}`); + cb(null, `${fileNameUUID}${req.body['fileExtension'].toLowerCase()}`); } else if (file.fieldname == 'thumbnailData') { - cb(null, `${file.originalname.split('.')[0]}.jpeg`); + cb(null, `${fileNameUUID}.jpeg`); } }, }),