diff --git a/web/apps/photos/src/components/PhotoFrame.tsx b/web/apps/photos/src/components/PhotoFrame.tsx index 90e1cf32c32e69572c98e2e4bbc9e2893a796f96..5ff70b3d45f2f958cea95fc588bfb01891909bcb 100644 --- a/web/apps/photos/src/components/PhotoFrame.tsx +++ b/web/apps/photos/src/components/PhotoFrame.tsx @@ -1,3 +1,4 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import { PHOTOS_PAGES } from "@ente/shared/constants/pages"; import { CustomError } from "@ente/shared/error"; @@ -5,7 +6,6 @@ import useMemoSingleThreaded from "@ente/shared/hooks/useMemoSingleThreaded"; import { styled } from "@mui/material"; import PhotoViewer from "components/PhotoViewer"; import { TRASH_SECTION } from "constants/collection"; -import { FILE_TYPE } from "constants/file"; import { useRouter } from "next/router"; import { GalleryContext } from "pages/gallery"; import PhotoSwipe from "photoswipe"; diff --git a/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderFileName.tsx b/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderFileName.tsx index 1bee86c25a9dc6e731d42cca2ab5754ec5937ef9..c1b25e85065c868194ff294bbeebeeca3a9e5ca0 100644 --- a/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderFileName.tsx +++ b/web/apps/photos/src/components/PhotoViewer/FileInfo/RenderFileName.tsx @@ -1,10 +1,10 @@ +import { FILE_TYPE } from "@/media/file"; import { nameAndExtension } from "@/next/file"; import log from "@/next/log"; import { FlexWrapper } from "@ente/shared/components/Container"; import PhotoOutlined from "@mui/icons-material/PhotoOutlined"; import VideocamOutlined from "@mui/icons-material/VideocamOutlined"; import Box from "@mui/material/Box"; -import { FILE_TYPE } from "constants/file"; import { useEffect, useState } from "react"; import { EnteFile } from "types/file"; import { makeHumanReadableStorage } from "utils/billing"; diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx index 29da75e534d843ba3261f78ef4ce9a6124e7ba54..552c531f5dade734400dd199627f89a5c54398ed 100644 --- a/web/apps/photos/src/components/PhotoViewer/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/index.tsx @@ -16,6 +16,7 @@ import { isSupportedRawFormat, } from "utils/file"; +import { FILE_TYPE } from "@/media/file"; import { FlexWrapper } from "@ente/shared/components/Container"; import EnteSpinner from "@ente/shared/components/EnteSpinner"; import AlbumOutlined from "@mui/icons-material/AlbumOutlined"; @@ -34,7 +35,6 @@ import InfoIcon from "@mui/icons-material/InfoOutlined"; import ReplayIcon from "@mui/icons-material/Replay"; import ZoomInOutlinedIcon from "@mui/icons-material/ZoomInOutlined"; import { Box, Button, styled } from "@mui/material"; -import { FILE_TYPE } from "constants/file"; import { defaultLivePhotoDefaultOptions, photoSwipeV4Events, diff --git a/web/apps/photos/src/components/PlaceholderThumbnails.tsx b/web/apps/photos/src/components/PlaceholderThumbnails.tsx index caafbdce6f4d68c3df9c12f0fa7388b86415a54e..7266bf178139e934b0436d289b0129158558280d 100644 --- a/web/apps/photos/src/components/PlaceholderThumbnails.tsx +++ b/web/apps/photos/src/components/PlaceholderThumbnails.tsx @@ -1,8 +1,8 @@ +import { FILE_TYPE } from "@/media/file"; import { Overlay } from "@ente/shared/components/Container"; import PhotoOutlined from "@mui/icons-material/PhotoOutlined"; import PlayCircleOutlineOutlined from "@mui/icons-material/PlayCircleOutlineOutlined"; import { styled } from "@mui/material"; -import { FILE_TYPE } from "constants/file"; interface Iprops { fileType: FILE_TYPE; diff --git a/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx b/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx index d7cf151e664a9c276354b229c3e030939096b343..87c45b59fd18f7f2f2aa45de61537863ddc26b0a 100644 --- a/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx +++ b/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx @@ -1,6 +1,6 @@ +import { FILE_TYPE } from "@/media/file"; import CloseIcon from "@mui/icons-material/Close"; import { IconButton } from "@mui/material"; -import { FILE_TYPE } from "constants/file"; import { t } from "i18next"; import memoize from "memoize-one"; import pDebounce from "p-debounce"; diff --git a/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx b/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx index 8704258f89a420f44d86ab5b895d897b5f3c22ea..b9288c59b2e83f7cc5c18153097c09fc6c085759 100644 --- a/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx +++ b/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx @@ -1,3 +1,4 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import { Overlay } from "@ente/shared/components/Container"; import { CustomError } from "@ente/shared/error"; @@ -11,7 +12,6 @@ import { StaticThumbnail, } from "components/PlaceholderThumbnails"; import { TRASH_SECTION } from "constants/collection"; -import { FILE_TYPE } from "constants/file"; import { GAP_BTW_TILES, IMAGE_CONTAINER_MAX_WIDTH } from "constants/gallery"; import { DeduplicateContext } from "pages/deduplicate"; import { GalleryContext } from "pages/gallery"; diff --git a/web/apps/photos/src/constants/file.ts b/web/apps/photos/src/constants/file.ts index 46065136c94a23eebacf73c45834c602619d5bcd..f8d2a5ad8c894a1fe2b145e95b2749d7fe3060fb 100644 --- a/web/apps/photos/src/constants/file.ts +++ b/web/apps/photos/src/constants/file.ts @@ -9,13 +9,6 @@ export const TYPE_HEIF = "heif"; export const TYPE_JPEG = "jpeg"; export const TYPE_JPG = "jpg"; -export enum FILE_TYPE { - IMAGE, - VIDEO, - LIVE_PHOTO, - OTHERS, -} - export const RAW_FORMATS = [ "heic", "rw2", diff --git a/web/apps/photos/src/constants/upload.ts b/web/apps/photos/src/constants/upload.ts index 1c677470eff2f60f3defb42020181143c11f8e93..75918fae0b992ed62620b1c80cbd975a34e97513 100644 --- a/web/apps/photos/src/constants/upload.ts +++ b/web/apps/photos/src/constants/upload.ts @@ -1,5 +1,5 @@ +import { FILE_TYPE } from "@/media/file"; import { ENCRYPTION_CHUNK_SIZE } from "@ente/shared/crypto/constants"; -import { FILE_TYPE } from "constants/file"; import { FileTypeInfo, Location } from "types/upload"; // list of format that were missed by type-detection for some files. diff --git a/web/apps/photos/src/services/clip-service.ts b/web/apps/photos/src/services/clip-service.ts index eae9590fd5f1c910ba24e94aace6db3bfe7ecb28..ab1ce928c5a4a5802b2771a687cb4903be037732 100644 --- a/web/apps/photos/src/services/clip-service.ts +++ b/web/apps/photos/src/services/clip-service.ts @@ -1,10 +1,10 @@ +import { FILE_TYPE } from "@/media/file"; import { ensureElectron } from "@/next/electron"; import log from "@/next/log"; import ComlinkCryptoWorker from "@ente/shared/crypto"; import { CustomError } from "@ente/shared/error"; import { Events, eventBus } from "@ente/shared/events"; import { LS_KEYS, getData } from "@ente/shared/storage/localStorage"; -import { FILE_TYPE } from "constants/file"; import isElectron from "is-electron"; import PQueue from "p-queue"; import { Embedding } from "types/embedding"; diff --git a/web/apps/photos/src/services/deduplicationService.ts b/web/apps/photos/src/services/deduplicationService.ts index 9d8ab399ff8efed0c60685c499eae4bf6384908c..f9416396f2799ef206761356a23c86e5399d1757 100644 --- a/web/apps/photos/src/services/deduplicationService.ts +++ b/web/apps/photos/src/services/deduplicationService.ts @@ -1,8 +1,8 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import HTTPService from "@ente/shared/network/HTTPService"; import { getEndpoint } from "@ente/shared/network/api"; import { getToken } from "@ente/shared/storage/localStorage/helpers"; -import { FILE_TYPE } from "constants/file"; import { EnteFile } from "types/file"; import { Metadata } from "types/upload"; import { hasFileHash } from "utils/upload"; diff --git a/web/apps/photos/src/services/download/index.ts b/web/apps/photos/src/services/download/index.ts index d2ad6b1f77c52400f51be712bf8761afb9663325..fe566700c81db8aec1999850b8fd3a731ce96299 100644 --- a/web/apps/photos/src/services/download/index.ts +++ b/web/apps/photos/src/services/download/index.ts @@ -1,3 +1,4 @@ +import { FILE_TYPE } from "@/media/file"; import { decodeLivePhoto } from "@/media/live-photo"; import { openCache, type BlobCache } from "@/next/blob-cache"; import log from "@/next/log"; @@ -8,7 +9,6 @@ import { CustomError } from "@ente/shared/error"; import { Events, eventBus } from "@ente/shared/events"; import { isPlaybackPossible } from "@ente/shared/media/video-playback"; import { Remote } from "comlink"; -import { FILE_TYPE } from "constants/file"; import isElectron from "is-electron"; import * as ffmpegService from "services/ffmpeg"; import { EnteFile } from "types/file"; diff --git a/web/apps/photos/src/services/export/index.ts b/web/apps/photos/src/services/export/index.ts index 0bf355d8d7f4d10cadd93bbc4591be3ebe2866a8..c949b4636021994de8d51de8b185ea133a2d6d9c 100644 --- a/web/apps/photos/src/services/export/index.ts +++ b/web/apps/photos/src/services/export/index.ts @@ -1,3 +1,4 @@ +import { FILE_TYPE } from "@/media/file"; import { decodeLivePhoto } from "@/media/live-photo"; import { ensureElectron } from "@/next/electron"; import log from "@/next/log"; @@ -11,7 +12,6 @@ import QueueProcessor, { CancellationStatus, RequestCanceller, } from "@ente/shared/utils/queueProcessor"; -import { FILE_TYPE } from "constants/file"; import { Collection } from "types/collection"; import { CollectionExportNames, diff --git a/web/apps/photos/src/services/export/migration.ts b/web/apps/photos/src/services/export/migration.ts index a8c4e5068920f3ac333bd6cb453412ac22ad4fb2..6c13ce7fb304bc8e3c1917edb482f4a1f91d1732 100644 --- a/web/apps/photos/src/services/export/migration.ts +++ b/web/apps/photos/src/services/export/migration.ts @@ -1,10 +1,10 @@ +import { FILE_TYPE } from "@/media/file"; import { decodeLivePhoto } from "@/media/live-photo"; import { ensureElectron } from "@/next/electron"; import log from "@/next/log"; import { LS_KEYS, getData } from "@ente/shared/storage/localStorage"; import { User } from "@ente/shared/user/types"; import { wait } from "@ente/shared/utils"; -import { FILE_TYPE } from "constants/file"; import { getLocalCollections } from "services/collectionService"; import downloadManager from "services/download"; import { getAllLocalFiles } from "services/fileService"; diff --git a/web/apps/photos/src/services/machineLearning/mlWorkManager.ts b/web/apps/photos/src/services/machineLearning/mlWorkManager.ts index c5df14b224a190ce98970df381889dd78e01d895..a00c24ad3a8bd0fdc10c694cc819eb8bf4b7775f 100644 --- a/web/apps/photos/src/services/machineLearning/mlWorkManager.ts +++ b/web/apps/photos/src/services/machineLearning/mlWorkManager.ts @@ -1,8 +1,8 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import { ComlinkWorker } from "@/next/worker/comlink-worker"; import { eventBus, Events } from "@ente/shared/events"; import { getToken, getUserID } from "@ente/shared/storage/localStorage/helpers"; -import { FILE_TYPE } from "constants/file"; import debounce from "debounce"; import PQueue from "p-queue"; import { JobResult } from "types/common/job"; diff --git a/web/apps/photos/src/services/machineLearning/readerService.ts b/web/apps/photos/src/services/machineLearning/readerService.ts index a18b3c9082efb752dbd98eda191ffdc4bfa2a76c..d4538064124e3038ce87b621e26a8654b63869e4 100644 --- a/web/apps/photos/src/services/machineLearning/readerService.ts +++ b/web/apps/photos/src/services/machineLearning/readerService.ts @@ -1,5 +1,5 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; -import { FILE_TYPE } from "constants/file"; import { MLSyncContext, MLSyncFileContext } from "types/machineLearning"; import { getLocalFileImageBitmap, diff --git a/web/apps/photos/src/services/searchService.ts b/web/apps/photos/src/services/searchService.ts index dfe6f20068b35e923eed9f585180d6a2ec9f8dff..362e76fbef497bab8750130ab40d3fc0568f56a6 100644 --- a/web/apps/photos/src/services/searchService.ts +++ b/web/apps/photos/src/services/searchService.ts @@ -1,6 +1,6 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import * as chrono from "chrono-node"; -import { FILE_TYPE } from "constants/file"; import { t } from "i18next"; import { Collection } from "types/collection"; import { EntityType, LocationTag, LocationTagData } from "types/entity"; diff --git a/web/apps/photos/src/services/typeDetectionService.ts b/web/apps/photos/src/services/typeDetectionService.ts index 5b53eecbc0a3394ca728a439fd40c0f5085e89f1..598b100465317765ab8eab3e292a108b59d5418d 100644 --- a/web/apps/photos/src/services/typeDetectionService.ts +++ b/web/apps/photos/src/services/typeDetectionService.ts @@ -1,7 +1,7 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import { ElectronFile } from "@/next/types/file"; import { CustomError } from "@ente/shared/error"; -import { FILE_TYPE } from "constants/file"; import { KNOWN_NON_MEDIA_FORMATS, WHITELISTED_FILE_FORMATS, diff --git a/web/apps/photos/src/services/updateCreationTimeWithExif.ts b/web/apps/photos/src/services/updateCreationTimeWithExif.ts index 667ae44f4ee47332e88ae55a049ea086aceb46f6..e446219150f081d3ff730beb5d2e09a1ed09ccba 100644 --- a/web/apps/photos/src/services/updateCreationTimeWithExif.ts +++ b/web/apps/photos/src/services/updateCreationTimeWithExif.ts @@ -1,7 +1,7 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import { validateAndGetCreationUnixTimeInMicroSeconds } from "@ente/shared/time"; import type { FixOption } from "components/FixCreationTime"; -import { FILE_TYPE } from "constants/file"; import { getFileType } from "services/typeDetectionService"; import { EnteFile } from "types/file"; import { diff --git a/web/apps/photos/src/services/upload/metadata.ts b/web/apps/photos/src/services/upload/metadata.ts index dcd83c3e3a3af44c50766e8ea672f200b32e6825..d6acb9abd3ad8100dac87e06f48233d0e50d9e4c 100644 --- a/web/apps/photos/src/services/upload/metadata.ts +++ b/web/apps/photos/src/services/upload/metadata.ts @@ -1,3 +1,4 @@ +import { FILE_TYPE } from "@/media/file"; import { getFileNameSize } from "@/next/file"; import log from "@/next/log"; import { ElectronFile } from "@/next/types/file"; @@ -10,7 +11,6 @@ import { } from "@ente/shared/time"; import type { DataStream } from "@ente/shared/utils/data-stream"; import { Remote } from "comlink"; -import { FILE_TYPE } from "constants/file"; import { FILE_READER_CHUNK_SIZE, NULL_LOCATION } from "constants/upload"; import * as ffmpegService from "services/ffmpeg"; import { getElectronFileStream, getFileStream } from "services/readerService"; diff --git a/web/apps/photos/src/services/upload/thumbnail.ts b/web/apps/photos/src/services/upload/thumbnail.ts index e2eccf9b890e5ee51e26b98580341429055eade4..d8ba3a20174066dc5c9a178469f47d9d13da9bcc 100644 --- a/web/apps/photos/src/services/upload/thumbnail.ts +++ b/web/apps/photos/src/services/upload/thumbnail.ts @@ -1,7 +1,7 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; import { type Electron } from "@/next/types/ipc"; import { withTimeout } from "@ente/shared/utils"; -import { FILE_TYPE } from "constants/file"; import { BLACK_THUMBNAIL_BASE64 } from "constants/upload"; import * as ffmpeg from "services/ffmpeg"; import { heicToJPEG } from "services/heic-convert"; diff --git a/web/apps/photos/src/services/upload/uploadManager.ts b/web/apps/photos/src/services/upload/uploadManager.ts index 0c54d0f02dca8b6c143a8024268a4adb8ba8ceef..3a99d35e13163d2bce09dfeef6ee2e34d520ee62 100644 --- a/web/apps/photos/src/services/upload/uploadManager.ts +++ b/web/apps/photos/src/services/upload/uploadManager.ts @@ -1,3 +1,4 @@ +import { FILE_TYPE } from "@/media/file"; import { potentialFileTypeFromExtension } from "@/media/live-photo"; import { ensureElectron } from "@/next/electron"; import { nameAndExtension } from "@/next/file"; @@ -11,7 +12,6 @@ import { Events, eventBus } from "@ente/shared/events"; import { wait } from "@ente/shared/utils"; import { Canceler } from "axios"; import { Remote } from "comlink"; -import { FILE_TYPE } from "constants/file"; import { RANDOM_PERCENTAGE_PROGRESS_FOR_PUT, UPLOAD_RESULT, diff --git a/web/apps/photos/src/services/upload/uploadService.ts b/web/apps/photos/src/services/upload/uploadService.ts index 9584b30ddc01d9257a42b15bcfe359961831775c..d6132b300cfab9d2a5f578275fd5208617a28670 100644 --- a/web/apps/photos/src/services/upload/uploadService.ts +++ b/web/apps/photos/src/services/upload/uploadService.ts @@ -1,3 +1,4 @@ +import { FILE_TYPE } from "@/media/file"; import { encodeLivePhoto } from "@/media/live-photo"; import { ensureElectron } from "@/next/electron"; import { basename } from "@/next/file"; @@ -9,7 +10,6 @@ import { EncryptionResult } from "@ente/shared/crypto/types"; import { CustomError, handleUploadError } from "@ente/shared/error"; import { isDataStream, type DataStream } from "@ente/shared/utils/data-stream"; import { Remote } from "comlink"; -import { FILE_TYPE } from "constants/file"; import { FILE_CHUNKS_COMBINED_FOR_A_UPLOAD_PART, FILE_READER_CHUNK_SIZE, diff --git a/web/apps/photos/src/types/search/index.ts b/web/apps/photos/src/types/search/index.ts index 29a1cffef2823dca8cf224d95773de67b9fdf2ed..5918bb9ddec7ba018840b8674a45639b4b837e54 100644 --- a/web/apps/photos/src/types/search/index.ts +++ b/web/apps/photos/src/types/search/index.ts @@ -1,4 +1,4 @@ -import { FILE_TYPE } from "constants/file"; +import { FILE_TYPE } from "@/media/file"; import { City } from "services/locationSearchService"; import { LocationTagData } from "types/entity"; import { EnteFile } from "types/file"; diff --git a/web/apps/photos/src/types/upload/index.ts b/web/apps/photos/src/types/upload/index.ts index c687911c71cf76be7f2b4e46f43a19a2eefb361e..bdcef330b24eb471153d15498076364d98a575fc 100644 --- a/web/apps/photos/src/types/upload/index.ts +++ b/web/apps/photos/src/types/upload/index.ts @@ -1,10 +1,10 @@ +import { FILE_TYPE } from "@/media/file"; import type { ElectronFile } from "@/next/types/file"; import { B64EncryptionResult, LocalFileAttributes, } from "@ente/shared/crypto/types"; import type { DataStream } from "@ente/shared/utils/data-stream"; -import { FILE_TYPE } from "constants/file"; import { Collection } from "types/collection"; import { FilePublicMagicMetadata, diff --git a/web/apps/photos/src/utils/file/index.ts b/web/apps/photos/src/utils/file/index.ts index 29502213e3e50cfdf3f93fcb71231abcf92e9873..9cc74373e77abe6e8f40c043546c1eb277a66d94 100644 --- a/web/apps/photos/src/utils/file/index.ts +++ b/web/apps/photos/src/utils/file/index.ts @@ -1,3 +1,4 @@ +import { FILE_TYPE } from "@/media/file"; import { decodeLivePhoto } from "@/media/live-photo"; import log from "@/next/log"; import { CustomErrorMessage, type Electron } from "@/next/types/ipc"; @@ -7,7 +8,6 @@ import { LS_KEYS, getData } from "@ente/shared/storage/localStorage"; import { User } from "@ente/shared/user/types"; import { downloadUsingAnchor, withTimeout } from "@ente/shared/utils"; import { - FILE_TYPE, RAW_FORMATS, SUPPORTED_RAW_FORMATS, TYPE_HEIC, diff --git a/web/apps/photos/src/utils/machineLearning/index.ts b/web/apps/photos/src/utils/machineLearning/index.ts index a89bccc4cade23f1539b85c30ae310aa41d372cc..4e9b795ec1caafdde54633658cb6f6672185c908 100644 --- a/web/apps/photos/src/utils/machineLearning/index.ts +++ b/web/apps/photos/src/utils/machineLearning/index.ts @@ -1,6 +1,6 @@ +import { FILE_TYPE } from "@/media/file"; import { decodeLivePhoto } from "@/media/live-photo"; import log from "@/next/log"; -import { FILE_TYPE } from "constants/file"; import PQueue from "p-queue"; import DownloadManager from "services/download"; import { getLocalFiles } from "services/fileService"; diff --git a/web/apps/photos/src/utils/photoFrame/index.ts b/web/apps/photos/src/utils/photoFrame/index.ts index faf0679e7fd5637e42a60a3910eadaa42d1a6ab2..ccd47b604d450948feeb9a9b9ef9c3bc0c9e38c2 100644 --- a/web/apps/photos/src/utils/photoFrame/index.ts +++ b/web/apps/photos/src/utils/photoFrame/index.ts @@ -1,5 +1,5 @@ +import { FILE_TYPE } from "@/media/file"; import log from "@/next/log"; -import { FILE_TYPE } from "constants/file"; import { LivePhotoSourceURL, SourceURLs } from "services/download"; import { EnteFile } from "types/file"; import { SetSelectedState } from "types/gallery"; diff --git a/web/apps/photos/tests/upload.test.ts b/web/apps/photos/tests/upload.test.ts index 5a05bb991d7b0aa3d30155ff7f8fe1970d65e900..3fc7e8541e15f2aa71421ce86b793b50dc2ec0ed 100644 --- a/web/apps/photos/tests/upload.test.ts +++ b/web/apps/photos/tests/upload.test.ts @@ -1,5 +1,5 @@ +import { FILE_TYPE } from "@/media/file"; import { tryToParseDateTime } from "@ente/shared/time"; -import { FILE_TYPE } from "constants/file"; import { getLocalCollections } from "services/collectionService"; import { getLocalFiles } from "services/fileService"; import {