diff --git a/web/apps/cast/src/types/file/index.ts b/web/apps/cast/src/types/file/index.ts index f6b868c55..c21f04a0a 100644 --- a/web/apps/cast/src/types/file/index.ts +++ b/web/apps/cast/src/types/file/index.ts @@ -1,9 +1,9 @@ +import type { Metadata } from "@/media/types/file"; import { EncryptedMagicMetadata, MagicMetadataCore, VISIBILITY_STATE, } from "types/magicMetadata"; -import { Metadata } from "types/upload"; export interface MetadataFileAttributes { encryptedData: string; diff --git a/web/apps/photos/src/services/deduplicationService.ts b/web/apps/photos/src/services/deduplicationService.ts index d591e89ff..dd865922a 100644 --- a/web/apps/photos/src/services/deduplicationService.ts +++ b/web/apps/photos/src/services/deduplicationService.ts @@ -4,7 +4,7 @@ import HTTPService from "@ente/shared/network/HTTPService"; import { getEndpoint } from "@ente/shared/network/api"; import { getToken } from "@ente/shared/storage/localStorage/helpers"; import { EnteFile } from "types/file"; -import { Metadata } from "types/upload"; +import type { Metadata } from "@/media/types/file"; import { hasFileHash } from "utils/upload"; const ENDPOINT = getEndpoint(); diff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.ts index 3ec98a8d0..5a732658a 100644 --- a/web/apps/photos/src/services/export/index.ts +++ b/web/apps/photos/src/services/export/index.ts @@ -1,5 +1,6 @@ import { FILE_TYPE } from "@/media/file-type"; import { decodeLivePhoto } from "@/media/live-photo"; +import type { Metadata } from "@/media/types/file"; import { ensureElectron } from "@/next/electron"; import log from "@/next/log"; import { CustomError } from "@ente/shared/error"; @@ -22,7 +23,6 @@ import { FileExportNames, } from "types/export"; import { EnteFile } from "types/file"; -import { Metadata } from "types/upload"; import { constructCollectionNameMap, getCollectionUserFacingName, diff --git a/web/apps/photos/src/services/upload/uploadService.ts b/web/apps/photos/src/services/upload/uploadService.ts index d2f7fbe7b..fb966b005 100644 --- a/web/apps/photos/src/services/upload/uploadService.ts +++ b/web/apps/photos/src/services/upload/uploadService.ts @@ -1,5 +1,6 @@ import { FILE_TYPE, type FileTypeInfo } from "@/media/file-type"; import { encodeLivePhoto } from "@/media/live-photo"; +import type { Metadata } from "@/media/types/file"; import { ensureElectron } from "@/next/electron"; import { basename, getFileNameSize } from "@/next/file"; import log from "@/next/log"; @@ -42,7 +43,6 @@ import { UploadURL, type FileWithCollection2, type LivePhotoAssets2, - type Metadata, type UploadAsset2, } from "types/upload"; import { diff --git a/web/apps/photos/src/types/file/index.ts b/web/apps/photos/src/types/file/index.ts index 2991e1f8b..c3d4cca44 100644 --- a/web/apps/photos/src/types/file/index.ts +++ b/web/apps/photos/src/types/file/index.ts @@ -1,10 +1,10 @@ +import type { Metadata } from "@/media/types/file"; import { SourceURLs } from "services/download"; import { EncryptedMagicMetadata, MagicMetadataCore, VISIBILITY_STATE, } from "types/magicMetadata"; -import { Metadata } from "types/upload"; export interface MetadataFileAttributes { encryptedData: string; diff --git a/web/apps/photos/src/types/upload/index.ts b/web/apps/photos/src/types/upload/index.ts index 9b2e37a9b..75ad97ef4 100644 --- a/web/apps/photos/src/types/upload/index.ts +++ b/web/apps/photos/src/types/upload/index.ts @@ -13,28 +13,6 @@ import { } from "types/file"; import { EncryptedMagicMetadata } from "types/magicMetadata"; -/** Information about the file that never changes post upload. */ -export interface Metadata { - /** - * The file name. - * - * See: [Note: File name for local EnteFile objects] - */ - title: string; - creationTime: number; - modificationTime: number; - latitude: number; - longitude: number; - /** The "Ente" file type. */ - fileType: FILE_TYPE; - hasStaticThumbnail?: boolean; - hash?: string; - imageHash?: string; - videoHash?: string; - localID?: number; - version?: number; - deviceFolder?: string; -} export interface Location { latitude: number; diff --git a/web/apps/photos/src/utils/upload/index.ts b/web/apps/photos/src/utils/upload/index.ts index 091026e7b..0894f1cc1 100644 --- a/web/apps/photos/src/utils/upload/index.ts +++ b/web/apps/photos/src/utils/upload/index.ts @@ -1,13 +1,10 @@ +import type { Metadata } from "@/media/types/file"; import { basename, dirname } from "@/next/file"; import { ElectronFile } from "@/next/types/file"; import { PICKED_UPLOAD_TYPE } from "constants/upload"; import isElectron from "is-electron"; import { exportMetadataDirectoryName } from "services/export"; -import { - FileWithCollection, - Metadata, - type FileWithCollection2, -} from "types/upload"; +import { FileWithCollection, type FileWithCollection2 } from "types/upload"; const TYPE_JSON = "json"; diff --git a/web/apps/cast/src/types/upload.ts b/web/packages/media/types/file.ts similarity index 58% rename from web/apps/cast/src/types/upload.ts rename to web/packages/media/types/file.ts index 27a47aa3b..ed5fb9fb3 100644 --- a/web/apps/cast/src/types/upload.ts +++ b/web/packages/media/types/file.ts @@ -1,11 +1,18 @@ -import { FILE_TYPE } from "@/media/file-type"; +import type { FILE_TYPE } from "../file-type"; +/** Information about the file that never changes post upload. */ export interface Metadata { + /** + * The file name. + * + * See: [Note: File name for local EnteFile objects] + */ title: string; creationTime: number; modificationTime: number; latitude: number; longitude: number; + /** The "Ente" file type. */ fileType: FILE_TYPE; hasStaticThumbnail?: boolean; hash?: string;