You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-07-04 05:50:38 +02:00
Added limit on total of file upload on web
This commit is contained in:
web/src
lib
components
shared-components
utils
routes
@ -1,10 +1,13 @@
|
||||
import {
|
||||
notificationController,
|
||||
NotificationType
|
||||
} from './../components/shared-components/notification/notification';
|
||||
/* @vite-ignore */
|
||||
import * as exifr from 'exifr';
|
||||
import { uploadAssetsStore } from '$lib/stores/upload';
|
||||
import type { UploadAsset } from '../models/upload-asset';
|
||||
import { api, AssetFileUploadResponseDto } from '@api';
|
||||
import { albumUploadAssetStore } from '$lib/stores/album-upload-asset';
|
||||
|
||||
/**
|
||||
* Determine if the upload is for album or for the user general backup
|
||||
* @variant GENERAL - Upload assets to the server for general backup
|
||||
@ -33,6 +36,15 @@ export const openFileUploadDialog = (uploadType: UploadType) => {
|
||||
fileSelector.onchange = async (e: any) => {
|
||||
const files = Array.from<File>(e.target.files);
|
||||
|
||||
if (files.length > 50) {
|
||||
notificationController.show({
|
||||
message: `Cannot upload more than 50 files at a time - you are uploading ${files.length} files`,
|
||||
type: NotificationType.Error
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const acceptedFile = files.filter(
|
||||
(e) => e.type.split('/')[0] === 'video' || e.type.split('/')[0] === 'image'
|
||||
);
|
||||
|
Reference in New Issue
Block a user