Skip to content

armgit / ente

Public Imported from GitHub
0

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

Merge

Manav Rathid2db4c9cfaba
diff --git a/web/apps/photos/src/services/collectionService.ts b/web/apps/photos/src/services/collectionService.ts
index 28aa2223b7..fa3f4959e5 100644
--- a/web/apps/photos/src/services/collectionService.ts
+++ b/web/apps/photos/src/services/collectionService.ts
@@ -30,8 +30,7 @@ import {
CollectionsSortBy,
} from "@/new/photos/services/collection/ui";
import { getLocalFiles, sortFiles } from "@/new/photos/services/files";
-import { EnteFile } from "@/new/photos/types/file";
-import { EncryptedMagicMetadata } from "@/new/photos/types/magicMetadata";
+import { EncryptedMagicMetadata, EnteFile } from "@/new/photos/types/file";
import { batch } from "@/utils/array";
import { CustomError } from "@ente/shared/error";
import HTTPService from "@ente/shared/network/HTTPService";
diff --git a/web/apps/photos/src/services/fileService.ts b/web/apps/photos/src/services/fileService.ts
index 688835985d..85ba3c5341 100644
--- a/web/apps/photos/src/services/fileService.ts
+++ b/web/apps/photos/src/services/fileService.ts
@@ -8,6 +8,7 @@ import {
setLocalFiles,
sortFiles,
} from "@/new/photos/services/files";
+import type { EncryptedMagicMetadata } from "@/new/photos/types/file";
import {
EncryptedEnteFile,
EnteFile,
@@ -27,7 +28,6 @@ import {
REQUEST_BATCH_SIZE,
setCollectionLastSyncTime,
} from "./collectionService";
-import type { EncryptedMagicMetadata } from "@/new/photos/types/magicMetadata";
/**
* Fetch all files of the given {@link type}, belonging to the given
diff --git a/web/apps/photos/src/services/upload/upload-service.ts b/web/apps/photos/src/services/upload/upload-service.ts
index 0e565258fc..d130041c1e 100644
--- a/web/apps/photos/src/services/upload/upload-service.ts
+++ b/web/apps/photos/src/services/upload/upload-service.ts
@@ -23,6 +23,7 @@ import {
UPLOAD_RESULT,
} from "@/new/photos/services/upload/types";
import {
+ EncryptedMagicMetadata,
EnteFile,
MetadataFileAttributes,
S3FileAttributes,
@@ -30,7 +31,6 @@ import {
type FilePublicMagicMetadata,
type FilePublicMagicMetadataProps,
} from "@/new/photos/types/file";
-import { EncryptedMagicMetadata } from "@/new/photos/types/magicMetadata";
import { detectFileTypeInfoFromChunk } from "@/new/photos/utils/detect-type";
import { readStream } from "@/new/photos/utils/native-stream";
import { ensure, ensureInteger, ensureNumber } from "@/utils/ensure";
diff --git a/web/apps/photos/src/utils/collection.ts b/web/apps/photos/src/utils/collection.ts
index 9195de9f07..62b1e4ce4b 100644
--- a/web/apps/photos/src/utils/collection.ts
+++ b/web/apps/photos/src/utils/collection.ts
@@ -6,11 +6,11 @@ import {
CollectionMagicMetadataProps,
CollectionPublicMagicMetadataProps,
CollectionType,
+ SUB_TYPE,
} from "@/media/collection";
import { ItemVisibility } from "@/media/file-metadata";
import { getAllLocalFiles, getLocalFiles } from "@/new/photos/services/files";
import { EnteFile } from "@/new/photos/types/file";
-import { SUB_TYPE } from "@/media/collection";
import { safeDirectoryName } from "@/new/photos/utils/native-fs";
import { CustomError } from "@ente/shared/error";
import { LS_KEYS, getData } from "@ente/shared/storage/localStorage";
diff --git a/web/apps/photos/src/utils/magicMetadata/index.ts b/web/apps/photos/src/utils/magicMetadata/index.ts
index 467e3cf04c..dccd8109a5 100644
--- a/web/apps/photos/src/utils/magicMetadata/index.ts
+++ b/web/apps/photos/src/utils/magicMetadata/index.ts
@@ -1,8 +1,7 @@
import { sharedCryptoWorker } from "@/base/crypto";
import type { Collection } from "@/media/collection";
import { ItemVisibility } from "@/media/file-metadata";
-import { EnteFile } from "@/new/photos/types/file";
-import { MagicMetadataCore } from "@/new/photos/types/magicMetadata";
+import { EnteFile, MagicMetadataCore } from "@/new/photos/types/file";
export function isArchivedFile(item: EnteFile): boolean {
if (!item || !item.magicMetadata || !item.magicMetadata.data) {
diff --git a/web/packages/media/collection.ts b/web/packages/media/collection.ts
index c1d0015ba4..10303f9621 100644
--- a/web/packages/media/collection.ts
+++ b/web/packages/media/collection.ts
@@ -3,7 +3,7 @@ import type { EnteFile } from "@/new/photos/types/file";
import {
type EncryptedMagicMetadata,
type MagicMetadataCore,
-} from "@/new/photos/types/magicMetadata";
+} from "@/new/photos/types/file";
// TODO: Audit this file
diff --git a/web/packages/new/photos/types/file.ts b/web/packages/new/photos/types/file.ts
index 03055cbf25..f2e7a80abb 100644
--- a/web/packages/new/photos/types/file.ts
+++ b/web/packages/new/photos/types/file.ts
@@ -1,8 +1,4 @@
import { type Metadata, ItemVisibility } from "@/media/file-metadata";
-import {
- type EncryptedMagicMetadata,
- type MagicMetadataCore,
-} from "./magicMetadata";
export interface MetadataFileAttributes {
encryptedData: string;
@@ -18,6 +14,15 @@ export interface FileInfo {
thumbSize: number;
}
+export interface MagicMetadataCore<T> {
+ version: number;
+ count: number;
+ header: string;
+ data: T;
+}
+
+export type EncryptedMagicMetadata = MagicMetadataCore<string>;
+
export interface EncryptedEnteFile {
id: number;
collectionID: number;
diff --git a/web/packages/new/photos/types/magicMetadata.ts b/web/packages/new/photos/types/magicMetadata.ts
deleted file mode 100644
index 4dcf6d2413..0000000000
--- a/web/packages/new/photos/types/magicMetadata.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-export interface MagicMetadataCore<T> {
- version: number;
- count: number;
- header: string;
- data: T;
-}
-
-export type EncryptedMagicMetadata = MagicMetadataCore<string>;