diff --git a/web/apps/photos/src/components/Collections/CollectionCard.tsx b/web/apps/photos/src/components/Collections/CollectionCard.tsx index 5bf247020e..7d757561ba 100644 --- a/web/apps/photos/src/components/Collections/CollectionCard.tsx +++ b/web/apps/photos/src/components/Collections/CollectionCard.tsx @@ -1,10 +1,10 @@ +import downloadManager from "@/new/photos/services/download"; import { EnteFile } from "@/new/photos/types/file"; import { LoadingThumbnail, StaticThumbnail, } from "components/PlaceholderThumbnails"; import { useEffect, useState } from "react"; -import downloadManager from "services/download"; export default function CollectionCard(props: { children?: any; diff --git a/web/apps/photos/src/components/PhotoFrame.tsx b/web/apps/photos/src/components/PhotoFrame.tsx index 6095a31765..a6f8606a08 100644 --- a/web/apps/photos/src/components/PhotoFrame.tsx +++ b/web/apps/photos/src/components/PhotoFrame.tsx @@ -1,4 +1,5 @@ import { FILE_TYPE } from "@/media/file-type"; +import DownloadManager from "@/new/photos/services/download"; import type { LivePhotoSourceURL, SourceURLs } from "@/new/photos/types/file"; import { EnteFile } from "@/new/photos/types/file"; import log from "@/next/log"; @@ -14,7 +15,6 @@ import PhotoSwipe from "photoswipe"; import { useContext, useEffect, useState } from "react"; import AutoSizer from "react-virtualized-auto-sizer"; import { Duplicate } from "services/deduplicationService"; -import DownloadManager from "services/download"; import { SelectedState, SetFilesDownloadProgressAttributesCreator, diff --git a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx index 0d41aba55d..3bb010d708 100644 --- a/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/ImageEditorOverlay/index.tsx @@ -1,3 +1,4 @@ +import downloadManager from "@/new/photos/services/download"; import { EnteFile } from "@/new/photos/types/file"; import { nameAndExtension } from "@/next/file"; import log from "@/next/log"; @@ -35,7 +36,6 @@ import { AppContext } from "pages/_app"; import type { Dispatch, MutableRefObject, SetStateAction } from "react"; import { createContext, useContext, useEffect, useRef, useState } from "react"; import { getLocalCollections } from "services/collectionService"; -import downloadManager from "services/download"; import uploadManager from "services/upload/uploadManager"; import { getEditorCloseConfirmationMessage } from "utils/ui"; import ColoursMenu from "./ColoursMenu"; diff --git a/web/apps/photos/src/components/PhotoViewer/index.tsx b/web/apps/photos/src/components/PhotoViewer/index.tsx index aff51460dd..56ad5475ec 100644 --- a/web/apps/photos/src/components/PhotoViewer/index.tsx +++ b/web/apps/photos/src/components/PhotoViewer/index.tsx @@ -15,6 +15,7 @@ import { import { FILE_TYPE } from "@/media/file-type"; import { isNonWebImageFileExtension } from "@/media/formats"; +import downloadManager from "@/new/photos/services/download"; import type { LoadedLivePhotoSourceURL } from "@/new/photos/types/file"; import { detectFileTypeInfo } from "@/new/photos/utils/detect-type"; import { isNativeConvertibleToJPEG } from "@/new/photos/utils/file"; @@ -45,7 +46,6 @@ import { t } from "i18next"; import isElectron from "is-electron"; import { AppContext } from "pages/_app"; import { GalleryContext } from "pages/gallery"; -import downloadManager from "services/download"; import { getParsedExifData } from "services/exif"; import { trashFiles } from "services/fileService"; import { SetFilesDownloadProgressAttributesCreator } from "types/gallery"; diff --git a/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx b/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx index 0b4c386c4b..6a5e8128bb 100644 --- a/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx +++ b/web/apps/photos/src/components/pages/gallery/PreviewCard.tsx @@ -1,4 +1,5 @@ import { FILE_TYPE } from "@/media/file-type"; +import DownloadManager from "@/new/photos/services/download"; import { EnteFile } from "@/new/photos/types/file"; import log from "@/next/log"; import { Overlay } from "@ente/shared/components/Container"; @@ -17,7 +18,6 @@ import i18n from "i18next"; import { DeduplicateContext } from "pages/deduplicate"; import { GalleryContext } from "pages/gallery"; import React, { useContext, useEffect, useRef, useState } from "react"; -import DownloadManager from "services/download"; import { shouldShowAvatar } from "utils/file"; import Avatar from "./Avatar"; diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsx index 98af7f9d67..a74c2b3ab1 100644 --- a/web/apps/photos/src/pages/_app.tsx +++ b/web/apps/photos/src/pages/_app.tsx @@ -1,3 +1,4 @@ +import DownloadManager from "@/new/photos/services/download"; import { clientPackageName, staticAppTitle } from "@/next/app"; import { CustomHead } from "@/next/components/Head"; import { setupI18n } from "@/next/i18n"; @@ -48,7 +49,6 @@ import { useRouter } from "next/router"; import "photoswipe/dist/photoswipe.css"; import { createContext, useContext, useEffect, useRef, useState } from "react"; import LoadingBar from "react-top-loading-bar"; -import DownloadManager from "services/download"; import { resumeExportsIfNeeded } from "services/export"; import { isFaceIndexingEnabled, diff --git a/web/apps/photos/src/pages/gallery/index.tsx b/web/apps/photos/src/pages/gallery/index.tsx index 8bac954cbb..42f3aed2c4 100644 --- a/web/apps/photos/src/pages/gallery/index.tsx +++ b/web/apps/photos/src/pages/gallery/index.tsx @@ -1,5 +1,6 @@ import { WhatsNew } from "@/new/photos/components/WhatsNew"; import { shouldShowWhatsNew } from "@/new/photos/services/changelog"; +import downloadManager from "@/new/photos/services/download"; import { getLocalFiles, getLocalTrashedFiles, @@ -92,7 +93,6 @@ import { getHiddenItemsSummary, getSectionSummaries, } from "services/collectionService"; -import downloadManager from "services/download"; import { syncFiles } from "services/fileService"; import locationSearchService from "services/locationSearchService"; import { sync } from "services/sync"; diff --git a/web/apps/photos/src/pages/shared-albums/index.tsx b/web/apps/photos/src/pages/shared-albums/index.tsx index 4e479457b1..b4786e1798 100644 --- a/web/apps/photos/src/pages/shared-albums/index.tsx +++ b/web/apps/photos/src/pages/shared-albums/index.tsx @@ -1,3 +1,4 @@ +import downloadManager from "@/new/photos/services/download"; import { EnteFile } from "@/new/photos/types/file"; import { mergeMetadata } from "@/new/photos/utils/file"; import log from "@/next/log"; @@ -45,7 +46,6 @@ import { useRouter } from "next/router"; import { AppContext } from "pages/_app"; import { useContext, useEffect, useMemo, useRef, useState } from "react"; import { useDropzone } from "react-dropzone"; -import downloadManager from "services/download"; import { getLocalPublicCollection, getLocalPublicCollectionPassword, diff --git a/web/apps/photos/src/services/clip-service.ts b/web/apps/photos/src/services/clip-service.ts index be59a2aeda..4b9900aed5 100644 --- a/web/apps/photos/src/services/clip-service.ts +++ b/web/apps/photos/src/services/clip-service.ts @@ -1,4 +1,5 @@ import { FILE_TYPE } from "@/media/file-type"; +import downloadManager from "@/new/photos/services/download"; import { getAllLocalFiles, getLocalFiles } from "@/new/photos/services/files"; import { EnteFile } from "@/new/photos/types/file"; import { ensureElectron } from "@/next/electron"; @@ -10,7 +11,6 @@ import { LS_KEYS, getData } from "@ente/shared/storage/localStorage"; import PQueue from "p-queue"; import { Embedding } from "types/embedding"; import { getPersonalFiles } from "utils/file"; -import downloadManager from "./download"; import { localCLIPEmbeddings, putEmbedding } from "./embeddingService"; /** Status of CLIP indexing on the images in the user's local library. */ diff --git a/web/apps/photos/src/services/export/migration.ts b/web/apps/photos/src/services/export/migration.ts index da506e11e1..1dfbe49d60 100644 --- a/web/apps/photos/src/services/export/migration.ts +++ b/web/apps/photos/src/services/export/migration.ts @@ -1,5 +1,6 @@ import { FILE_TYPE } from "@/media/file-type"; import { decodeLivePhoto } from "@/media/live-photo"; +import downloadManager from "@/new/photos/services/download"; import { exportMetadataDirectoryName } from "@/new/photos/services/export"; import { getAllLocalFiles } from "@/new/photos/services/files"; import { EnteFile } from "@/new/photos/types/file"; @@ -16,7 +17,6 @@ import { wait } from "@/utils/promise"; import { LS_KEYS, getData } from "@ente/shared/storage/localStorage"; import type { User } from "@ente/shared/user/types"; import { getLocalCollections } from "services/collectionService"; -import downloadManager from "services/download"; import { Collection } from "types/collection"; import { CollectionExportNames, diff --git a/web/apps/photos/src/services/face/f-index.ts b/web/apps/photos/src/services/face/f-index.ts index 539fdc7411..48b37acb52 100644 --- a/web/apps/photos/src/services/face/f-index.ts +++ b/web/apps/photos/src/services/face/f-index.ts @@ -1,5 +1,6 @@ import { FILE_TYPE } from "@/media/file-type"; import { decodeLivePhoto } from "@/media/live-photo"; +import DownloadManager from "@/new/photos/services/download"; import type { Box, Dimensions, @@ -12,7 +13,6 @@ import { getRenderableImage } from "@/new/photos/utils/file"; import log from "@/next/log"; import { workerBridge } from "@/next/worker/worker-bridge"; import { Matrix } from "ml-matrix"; -import DownloadManager from "services/download"; import { getSimilarityTransformation } from "similarity-transformation"; import { Matrix as TransformationMatrix, diff --git a/web/apps/photos/src/services/face/face.worker.ts b/web/apps/photos/src/services/face/face.worker.ts index d74c235cc0..f5cc4b8b6f 100644 --- a/web/apps/photos/src/services/face/face.worker.ts +++ b/web/apps/photos/src/services/face/face.worker.ts @@ -1,6 +1,6 @@ +import downloadManager from "@/new/photos/services/download"; import { EnteFile } from "@/new/photos/types/file"; import { expose } from "comlink"; -import downloadManager from "services/download"; import mlService from "services/machineLearning/machineLearningService"; export class DedicatedMLWorker { diff --git a/web/apps/photos/src/services/fix-exif.ts b/web/apps/photos/src/services/fix-exif.ts index d212b31f11..fc504ea622 100644 --- a/web/apps/photos/src/services/fix-exif.ts +++ b/web/apps/photos/src/services/fix-exif.ts @@ -1,4 +1,5 @@ import { FILE_TYPE } from "@/media/file-type"; +import downloadManager from "@/new/photos/services/download"; import { EnteFile } from "@/new/photos/types/file"; import { detectFileTypeInfo } from "@/new/photos/utils/detect-type"; import log from "@/next/log"; @@ -8,7 +9,6 @@ import { changeFileCreationTime, updateExistingFilePubMetadata, } from "utils/file"; -import downloadManager from "./download"; import { getParsedExifData } from "./exif"; const EXIF_TIME_TAGS = [ diff --git a/web/apps/photos/src/services/logout.ts b/web/apps/photos/src/services/logout.ts index 266247ca98..b754a6e445 100644 --- a/web/apps/photos/src/services/logout.ts +++ b/web/apps/photos/src/services/logout.ts @@ -1,10 +1,10 @@ +import DownloadManager from "@/new/photos/services/download"; import { terminateFaceWorker } from "@/new/photos/services/face"; import { clearFaceData } from "@/new/photos/services/face/db"; import { clearFeatureFlagSessionState } from "@/new/photos/services/feature-flags"; import log from "@/next/log"; import { accountLogout } from "@ente/accounts/services/logout"; import { clipService } from "services/clip-service"; -import DownloadManager from "./download"; import exportService from "./export"; import mlWorkManager from "./face/mlWorkManager"; diff --git a/web/apps/photos/src/utils/file/index.ts b/web/apps/photos/src/utils/file/index.ts index 13b3c2fe61..6f2b3b89fb 100644 --- a/web/apps/photos/src/utils/file/index.ts +++ b/web/apps/photos/src/utils/file/index.ts @@ -1,5 +1,6 @@ import { FILE_TYPE } from "@/media/file-type"; import { decodeLivePhoto } from "@/media/live-photo"; +import DownloadManager from "@/new/photos/services/download"; import { EncryptedEnteFile, EnteFile, @@ -24,7 +25,6 @@ import type { User } from "@ente/shared/user/types"; import { downloadUsingAnchor } from "@ente/shared/utils"; import { t } from "i18next"; import { moveToHiddenCollection } from "services/collectionService"; -import DownloadManager from "services/download"; import { updateFileCreationDateInEXIF } from "services/exif"; import { deleteFromTrash,