From d1069dcfbb6ff362fc67e650ecca89dd74374a2d Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Fri, 19 Apr 2024 16:06:24 +0530 Subject: [PATCH] Dig a gully on the side --- web/apps/photos/src/types/upload/index.ts | 17 +++++++++++++++++ web/apps/photos/src/utils/upload/index.ts | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/web/apps/photos/src/types/upload/index.ts b/web/apps/photos/src/types/upload/index.ts index 35164ec47..78b46670c 100644 --- a/web/apps/photos/src/types/upload/index.ts +++ b/web/apps/photos/src/types/upload/index.ts @@ -105,6 +105,23 @@ export interface FileWithCollection extends UploadAsset { collectionID?: number; } +export interface UploadAsset2 { + isLivePhoto?: boolean; + file?: File | ElectronFile | string; + livePhotoAssets?: LivePhotoAssets2; +} + +export interface LivePhotoAssets2 { + image: File | ElectronFile | string; + video: File | ElectronFile | string; +} + +export interface FileWithCollection2 extends UploadAsset2 { + localID: number; + collection?: Collection; + collectionID?: number; +} + export type ParsedMetadataJSONMap = Map; export interface UploadURL { diff --git a/web/apps/photos/src/utils/upload/index.ts b/web/apps/photos/src/utils/upload/index.ts index 87d885c27..580fe8706 100644 --- a/web/apps/photos/src/utils/upload/index.ts +++ b/web/apps/photos/src/utils/upload/index.ts @@ -204,7 +204,8 @@ export function groupFilesBasedOnParentFolder( if (!collectionNameToFilesMap.has(folderName)) { collectionNameToFilesMap.set(folderName, []); } - collectionNameToFilesMap.get(folderName).push(file); + // TODO: Remove the cast + collectionNameToFilesMap.get(folderName).push(file as any); } return collectionNameToFilesMap; }