Skip to content

armgit / ente

Public Imported from GitHub
0

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

Update

Manav Rathibf3373697f2e
diff --git a/web/apps/photos/src/components/FileListWithViewer.tsx b/web/apps/photos/src/components/FileListWithViewer.tsx
index 9725376b52..e071c99c52 100644
--- a/web/apps/photos/src/components/FileListWithViewer.tsx
+++ b/web/apps/photos/src/components/FileListWithViewer.tsx
@@ -14,7 +14,7 @@ import {
import { t } from "i18next";
import { useCallback, useMemo, useState } from "react";
import AutoSizer from "react-virtualized-auto-sizer";
-import uploadManager from "services/upload/uploadManager";
+import { uploadManager } from "services/upload-manager";
import { SetFilesDownloadProgressAttributesCreator } from "types/gallery";
import { downloadSingleFile } from "utils/file";
import {
diff --git a/web/apps/photos/src/components/GalleryEmptyState.tsx b/web/apps/photos/src/components/GalleryEmptyState.tsx
index da1dcf1a2c..f4c7bad76b 100644
--- a/web/apps/photos/src/components/GalleryEmptyState.tsx
+++ b/web/apps/photos/src/components/GalleryEmptyState.tsx
@@ -8,7 +8,7 @@ import {
} from "ente-shared/components/Container";
import { t } from "i18next";
import { Trans } from "react-i18next";
-import uploadManager from "services/upload/uploadManager";
+import { uploadManager } from "services/upload-manager";
export default function GalleryEmptyState({ openUploader }) {
return (
diff --git a/web/apps/photos/src/components/Upload.tsx b/web/apps/photos/src/components/Upload.tsx
index e3a5bdc3b9..7738324f4f 100644
--- a/web/apps/photos/src/components/Upload.tsx
+++ b/web/apps/photos/src/components/Upload.tsx
@@ -65,8 +65,8 @@ import type {
UploadCounter,
UploadFileNames,
UploadItemWithCollection,
-} from "services/upload/uploadManager";
-import uploadManager from "services/upload/uploadManager";
+} from "services/upload-manager";
+import { uploadManager } from "services/upload-manager";
import watcher from "services/watch";
import { SetLoading } from "types/gallery";
import { getOrCreateAlbum } from "utils/collection";
diff --git a/web/apps/photos/src/components/UploadProgress.tsx b/web/apps/photos/src/components/UploadProgress.tsx
index 71fba1592c..ee81e62b27 100644
--- a/web/apps/photos/src/components/UploadProgress.tsx
+++ b/web/apps/photos/src/components/UploadProgress.tsx
@@ -39,7 +39,7 @@ import type {
SegregatedFinishedUploads,
UploadCounter,
UploadFileNames,
-} from "services/upload/uploadManager";
+} from "services/upload-manager";
interface UploadProgressProps {
open: boolean;
diff --git a/web/apps/photos/src/pages/gallery.tsx b/web/apps/photos/src/pages/gallery.tsx
index f5f7d8d620..a67cd70716 100644
--- a/web/apps/photos/src/pages/gallery.tsx
+++ b/web/apps/photos/src/pages/gallery.tsx
@@ -116,7 +116,7 @@ import {
removeFromFavorites,
} from "services/collectionService";
import exportService from "services/export";
-import uploadManager from "services/upload/uploadManager";
+import { uploadManager } from "services/upload-manager";
import { isTokenValid } from "services/userService";
import {
GalleryContextType,
diff --git a/web/apps/photos/src/pages/shared-albums.tsx b/web/apps/photos/src/pages/shared-albums.tsx
index 4e9a2447eb..6121f9ad51 100644
--- a/web/apps/photos/src/pages/shared-albums.tsx
+++ b/web/apps/photos/src/pages/shared-albums.tsx
@@ -73,7 +73,7 @@ import {
savePublicCollectionPassword,
syncPublicFiles,
} from "services/publicCollectionService";
-import uploadManager from "services/upload/uploadManager";
+import { uploadManager } from "services/upload-manager";
import {
SelectedState,
SetFilesDownloadProgressAttributes,
diff --git a/web/apps/photos/src/services/logout.ts b/web/apps/photos/src/services/logout.ts
index 6883eff11f..c17796a39a 100644
--- a/web/apps/photos/src/services/logout.ts
+++ b/web/apps/photos/src/services/logout.ts
@@ -12,7 +12,7 @@ import { logoutSearch } from "ente-new/photos/services/search";
import { logoutSettings } from "ente-new/photos/services/settings";
import { logoutUserDetails } from "ente-new/photos/services/user-details";
import exportService from "./export";
-import uploadManager from "./upload/uploadManager";
+import { uploadManager } from "./upload-manager";
/**
* Logout sequence for the photos app.
diff --git a/web/apps/photos/src/services/upload-manager.ts b/web/apps/photos/src/services/upload-manager.ts
index c2ee02feed..1a24dc1bbd 100644
--- a/web/apps/photos/src/services/upload-manager.ts
+++ b/web/apps/photos/src/services/upload-manager.ts
@@ -14,6 +14,18 @@ import {
type UploadPhase,
type UploadResult,
} from "ente-gallery/services/upload";
+import {
+ metadataJSONMapKeyForJSON,
+ tryParseTakeoutMetadataJSON,
+ type ParsedMetadataJSON,
+} from "ente-gallery/services/upload/takeout";
+import UploadService, {
+ areLivePhotoAssets,
+ uploadItemFileName,
+ uploader,
+ type PotentialLivePhotoAsset,
+ type UploadAsset,
+} from "ente-gallery/services/upload/upload-service";
import { processVideoNewUpload } from "ente-gallery/services/video";
import type { Collection } from "ente-media/collection";
import {
@@ -34,18 +46,6 @@ import {
} from "services/publicCollectionService";
import watcher from "services/watch";
import { getUserOwnedFiles } from "utils/file";
-import {
- metadataJSONMapKeyForJSON,
- tryParseTakeoutMetadataJSON,
- type ParsedMetadataJSON,
-} from "./takeout";
-import UploadService, {
- areLivePhotoAssets,
- uploadItemFileName,
- uploader,
- type PotentialLivePhotoAsset,
- type UploadAsset,
-} from "./upload-service";
export type FileID = number;
@@ -705,7 +705,10 @@ class UploadManager {
};
}
-export default new UploadManager();
+/**
+ * Singleton instance of {@link UploadManager}.
+ */
+export const uploadManager = new UploadManager();
/**
* The data operated on by the intermediate stages of the upload.
diff --git a/web/apps/photos/src/services/watch.ts b/web/apps/photos/src/services/watch.ts
index 3088158167..b8e82acd00 100644
--- a/web/apps/photos/src/services/watch.ts
+++ b/web/apps/photos/src/services/watch.ts
@@ -20,10 +20,8 @@ import {
groupFilesByCollectionID,
} from "ente-new/photos/services/files";
import { ensureString } from "ente-utils/ensure";
-import uploadManager, {
- type UploadItemWithCollection,
-} from "services/upload/uploadManager";
import { removeFromCollection } from "./collectionService";
+import { type UploadItemWithCollection, uploadManager } from "./upload-manager";
/**
* Watch for file system folders and automatically update the corresponding Ente
diff --git a/web/packages/gallery/services/upload/upload-service.ts b/web/packages/gallery/services/upload/upload-service.ts
index 928332b9fa..dba72d5089 100644
--- a/web/packages/gallery/services/upload/upload-service.ts
+++ b/web/packages/gallery/services/upload/upload-service.ts
@@ -57,7 +57,7 @@ import {
generateThumbnailNative,
generateThumbnailWeb,
} from "./thumbnail";
-import type { UploadableUploadItem } from "./uploadManager";
+import type { UploadableUploadItem } from "./upload-manager";
const publicUploadHttpClient = new PublicUploadHttpClient();
const UploadHttpClient = new PhotosUploadHttpClient();