π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Move
Manav Rathid7f11f72be5f
diff --git a/web/apps/photos/src/components/Search/SearchBar/searchInput/MenuWithPeople.tsx b/web/apps/photos/src/components/Search/SearchBar/searchInput/MenuWithPeople.tsxindex 1ea50873c7..b9b7ea88d5 100644--- a/web/apps/photos/src/components/Search/SearchBar/searchInput/MenuWithPeople.tsx+++ b/web/apps/photos/src/components/Search/SearchBar/searchInput/MenuWithPeople.tsx@@ -5,8 +5,8 @@ import { t } from "i18next";import { AppContext } from "pages/_app";import { useContext } from "react";import { components } from "react-select";+import { IndexStatus } from "services/ml/db";import { Suggestion, SuggestionType } from "types/search";-import { IndexStatus } from "utils/storage/mlIDbStorage";const { Menu } = components;diff --git a/web/apps/photos/src/components/Sidebar/UtilitySection.tsx b/web/apps/photos/src/components/Sidebar/UtilitySection.tsxindex 6b4a6f43d5..32f61d9764 100644--- a/web/apps/photos/src/components/Sidebar/UtilitySection.tsx+++ b/web/apps/photos/src/components/Sidebar/UtilitySection.tsx@@ -9,7 +9,7 @@ import { t } from "i18next";import { useRouter } from "next/router";import { AppContext } from "pages/_app";import { useContext, useState } from "react";-// import mlIDbStorage from 'utils/storage/mlIDbStorage';+// import mlIDbStorage from 'services/ml/db';import {configurePasskeyRecovery,isPasskeyRecoveryEnabled,diff --git a/web/apps/photos/src/components/ml/PeopleList.tsx b/web/apps/photos/src/components/ml/PeopleList.tsxindex f8f1c2ed3e..4ff61e044d 100644--- a/web/apps/photos/src/components/ml/PeopleList.tsx+++ b/web/apps/photos/src/components/ml/PeopleList.tsx@@ -3,9 +3,9 @@ import { Skeleton, styled } from "@mui/material";import { Legend } from "components/PhotoViewer/styledComponents/Legend";import { t } from "i18next";import React, { useEffect, useState } from "react";+import mlIDbStorage from "services/ml/db";import { Face, Person, type MlFileData } from "services/ml/types";import { EnteFile } from "types/file";-import mlIDbStorage from "utils/storage/mlIDbStorage";const FaceChipContainer = styled("div")`display: flex;diff --git a/web/apps/photos/src/pages/_app.tsx b/web/apps/photos/src/pages/_app.tsxindex 16670b6e4b..77e724d292 100644--- a/web/apps/photos/src/pages/_app.tsx+++ b/web/apps/photos/src/pages/_app.tsx@@ -53,6 +53,10 @@ import { createContext, useEffect, useRef, useState } from "react";import LoadingBar from "react-top-loading-bar";import DownloadManager from "services/download";import exportService, { resumeExportsIfNeeded } from "services/export";+import {+ getMLSearchConfig,+ updateMLSearchConfig,+} from "services/machineLearning/machineLearningService";import mlWorkManager from "services/machineLearning/mlWorkManager";import {getFamilyPortalRedirectURL,@@ -64,10 +68,6 @@ import {NotificationAttributes,SetNotificationAttributes,} from "types/Notification";-import {- getMLSearchConfig,- updateMLSearchConfig,-} from "services/machineLearning/machineLearningService";import {getUpdateAvailableForDownloadMessage,getUpdateReadyToInstallMessage,diff --git a/web/apps/photos/src/services/machineLearning/faceService.ts b/web/apps/photos/src/services/machineLearning/faceService.tsindex c447fe3963..b7805b3360 100644--- a/web/apps/photos/src/services/machineLearning/faceService.ts+++ b/web/apps/photos/src/services/machineLearning/faceService.ts@@ -1,5 +1,6 @@import { openCache } from "@/next/blob-cache";import log from "@/next/log";+import mlIDbStorage from "services/ml/db";import {DetectedFace,Face,@@ -9,7 +10,6 @@ import {type Versioned,} from "services/ml/types";import { imageBitmapToBlob, warpAffineFloat32List } from "utils/image";-import mlIDbStorage from "utils/storage/mlIDbStorage";import ReaderService, {getFaceId,getLocalFile,diff --git a/web/apps/photos/src/services/machineLearning/machineLearningService.ts b/web/apps/photos/src/services/machineLearning/machineLearningService.tsindex 7aeb93b3d6..4fc9ad4aa3 100644--- a/web/apps/photos/src/services/machineLearning/machineLearningService.ts+++ b/web/apps/photos/src/services/machineLearning/machineLearningService.ts@@ -5,6 +5,11 @@ import { CustomError, parseUploadErrorCodes } from "@ente/shared/error";import downloadManager from "services/download";import { putEmbedding } from "services/embeddingService";import { getLocalFiles } from "services/fileService";+import mlIDbStorage, {+ ML_SEARCH_CONFIG_NAME,+ ML_SYNC_CONFIG_NAME,+ ML_SYNC_JOB_CONFIG_NAME,+} from "services/ml/db";import {ClipEmbedding,Face,@@ -19,11 +24,6 @@ import {} from "services/ml/types";import { JobConfig } from "types/common/job";import { EnteFile } from "types/file";-import mlIDbStorage, {- ML_SEARCH_CONFIG_NAME,- ML_SYNC_CONFIG_NAME,- ML_SYNC_JOB_CONFIG_NAME,-} from "utils/storage/mlIDbStorage";import { isInternalUserForML } from "utils/user";import FaceService from "./faceService";import PeopleService from "./peopleService";diff --git a/web/apps/photos/src/services/machineLearning/mlWorkManager.ts b/web/apps/photos/src/services/machineLearning/mlWorkManager.tsindex 9f3b401bf5..5a1e670567 100644--- a/web/apps/photos/src/services/machineLearning/mlWorkManager.ts+++ b/web/apps/photos/src/services/machineLearning/mlWorkManager.ts@@ -6,12 +6,12 @@ import { getToken, getUserID } from "@ente/shared/storage/localStorage/helpers";import debounce from "debounce";import PQueue from "p-queue";import { getMLSyncJobConfig } from "services/machineLearning/machineLearningService";+import mlIDbStorage from "services/ml/db";import { MLSyncResult } from "services/ml/types";import { JobResult } from "types/common/job";import { EnteFile } from "types/file";import { getDedicatedMLWorker } from "utils/comlink/ComlinkMLWorker";import { SimpleJob } from "utils/common/job";-import mlIDbStorage from "utils/storage/mlIDbStorage";import { DedicatedMLWorker } from "worker/ml.worker";import { logQueueStats } from "./machineLearningService";diff --git a/web/apps/photos/src/services/machineLearning/peopleService.ts b/web/apps/photos/src/services/machineLearning/peopleService.tsindex 5c515afe3f..f7d5cf38a1 100644--- a/web/apps/photos/src/services/machineLearning/peopleService.ts+++ b/web/apps/photos/src/services/machineLearning/peopleService.ts@@ -1,6 +1,6 @@import log from "@/next/log";+import mlIDbStorage from "services/ml/db";import { Face, MLSyncContext, Person } from "services/ml/types";-import mlIDbStorage from "utils/storage/mlIDbStorage";import FaceService, { isDifferentOrOld } from "./faceService";import { getLocalFile, getOriginalImageBitmap } from "./readerService";diff --git a/web/apps/photos/src/utils/storage/mlIDbStorage.ts b/web/apps/photos/src/services/ml/db.tssimilarity index 100%rename from web/apps/photos/src/utils/storage/mlIDbStorage.tsrename to web/apps/photos/src/services/ml/db.tsdiff --git a/web/apps/photos/src/services/searchService.ts b/web/apps/photos/src/services/searchService.tsindex 6cde64cffb..ef49b126d1 100644--- a/web/apps/photos/src/services/searchService.ts+++ b/web/apps/photos/src/services/searchService.ts@@ -3,6 +3,7 @@ import log from "@/next/log";import * as chrono from "chrono-node";import { t } from "i18next";import { getMLSyncConfig } from "services/machineLearning/machineLearningService";+import mlIDbStorage from "services/ml/db";import { Person } from "services/ml/types";import { Collection } from "types/collection";import { EntityType, LocationTag, LocationTagData } from "types/entity";@@ -18,7 +19,6 @@ import {import ComlinkSearchWorker from "utils/comlink/ComlinkSearchWorker";import { getUniqueFiles } from "utils/file";import { getFormattedDate } from "utils/search";-import mlIDbStorage from "utils/storage/mlIDbStorage";import { clipService, computeClipMatchScore } from "./clip-service";import { getLocalEmbeddings } from "./embeddingService";import { getLatestEntities } from "./entityService";diff --git a/web/apps/photos/src/types/search/index.ts b/web/apps/photos/src/types/search/index.tsindex 7cff13298f..e08b842a30 100644--- a/web/apps/photos/src/types/search/index.ts+++ b/web/apps/photos/src/types/search/index.ts@@ -1,9 +1,9 @@import { FILE_TYPE } from "@/media/file-type";import { City } from "services/locationSearchService";+import { IndexStatus } from "services/ml/db";import { Person } from "services/ml/types";import { LocationTagData } from "types/entity";import { EnteFile } from "types/file";-import { IndexStatus } from "utils/storage/mlIDbStorage";export enum SuggestionType {DATE = "DATE",