Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Make tsc happy to allow builds to complete

Manav Rathie5545e9c804c
diff --git a/web/apps/photos/src/components/Upload/Uploader.tsx b/web/apps/photos/src/components/Upload/Uploader.tsx
index c340ee1dc3..8fe263a0a3 100644
--- a/web/apps/photos/src/components/Upload/Uploader.tsx
+++ b/web/apps/photos/src/components/Upload/Uploader.tsx
@@ -490,7 +490,8 @@ export default function Uploader(props: Props) {
throw e;
}
await waitInQueueAndUploadFiles(
- filesWithCollectionToUpload,
+ /* TODO(MR): ElectronFile changes */
+ filesWithCollectionToUpload as FileWithCollection[],
collections,
);
toUploadFiles.current = null;
@@ -569,7 +570,8 @@ export default function Uploader(props: Props) {
if (isElectron()) {
if (watcher.isUploadRunning()) {
await watcher.allFileUploadsDone(
- filesWithCollectionToUploadIn,
+ /* TODO(MR): ElectronFile changes */
+ filesWithCollectionToUploadIn as FileWithCollection2[],
collections,
);
} else if (watcher.isSyncPaused()) {
diff --git a/web/apps/photos/src/services/upload/uploadManager.ts b/web/apps/photos/src/services/upload/uploadManager.ts
index 3a99d35e13..7f24f6cba6 100644
--- a/web/apps/photos/src/services/upload/uploadManager.ts
+++ b/web/apps/photos/src/services/upload/uploadManager.ts
@@ -364,11 +364,17 @@ class UploadManager {
this.uiService.setUploadStage(
UPLOAD_STAGES.READING_GOOGLE_METADATA_FILES,
);
- await this.parseMetadataJSONFiles(metadataJSONFiles);
+ /* TODO(MR): ElectronFile changes */
+ await this.parseMetadataJSONFiles(
+ metadataJSONFiles as FileWithCollection2[],
+ );
}
if (mediaFiles.length) {
- const clusteredMediaFiles = clusterLivePhotos(mediaFiles);
+ /* TODO(MR): ElectronFile changes */
+ const clusteredMediaFiles = clusterLivePhotos(
+ mediaFiles as ClusterableFile[],
+ );
if (uploadCancelService.isUploadCancelationRequested()) {
throw Error(CustomError.UPLOAD_CANCELLED);
@@ -378,7 +384,8 @@ class UploadManager {
new Map<number, string>(
clusteredMediaFiles.map((mediaFile) => [
mediaFile.localID,
- assetName(mediaFile),
+ /* TODO(MR): ElectronFile changes */
+ assetName(mediaFile as FileWithCollection2),
]),
),
);
@@ -387,7 +394,10 @@ class UploadManager {
mediaFiles.length !== clusteredMediaFiles.length,
);
- await this.uploadMediaFiles(clusteredMediaFiles);
+ /* TODO(MR): ElectronFile changes */
+ await this.uploadMediaFiles(
+ clusteredMediaFiles as FileWithCollection2[],
+ );
}
} catch (e) {
if (e.message === CustomError.UPLOAD_CANCELLED) {
@@ -721,7 +731,7 @@ type ClusterableFile = {
localID: number;
collectionID: number;
// fileOrPath: File | ElectronFile | string;
- file: File | ElectronFile | string;
+ file?: File | ElectronFile | string;
};
type ClusteredFile = ClusterableFile & {
@@ -770,8 +780,13 @@ const clusterLivePhotos = (mediaFiles: ClusterableFile[]) => {
collectionID: f.collectionID,
isLivePhoto: true,
livePhotoAssets: {
- image: fFileType == FILE_TYPE.IMAGE ? f.file : g.file,
- video: fFileType == FILE_TYPE.IMAGE ? g.file : f.file,
+ /* TODO(MR): ElectronFile changes */
+ image: (fFileType == FILE_TYPE.IMAGE ? f.file : g.file) as
+ | string
+ | File,
+ video: (fFileType == FILE_TYPE.IMAGE ? g.file : f.file) as
+ | string
+ | File,
},
});
index += 2;
diff --git a/web/apps/photos/src/services/upload/uploadService.ts b/web/apps/photos/src/services/upload/uploadService.ts
index 7ead795b76..97fbba988d 100644
--- a/web/apps/photos/src/services/upload/uploadService.ts
+++ b/web/apps/photos/src/services/upload/uploadService.ts
@@ -195,7 +195,7 @@ export const uploader = async (
const { metadata, publicMagicMetadata } = await extractAssetMetadata(
worker,
parsedMetadataJSONMap,
- uploadAsset,
+ uploadAsset2,
collection.id,
fileTypeInfo,
);
@@ -229,7 +229,7 @@ export const uploader = async (
abortIfCancelled();
- const file = await readAsset(fileTypeInfo, uploadAsset);
+ const file = await readAsset(fileTypeInfo, uploadAsset2);
if (file.hasStaticThumbnail) metadata.hasStaticThumbnail = true;