Manav Rathi 1 jaar geleden
bovenliggende
commit
d7f11f72be

+ 1 - 1
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;
 

+ 1 - 1
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,

+ 1 - 1
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;

+ 4 - 4
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,

+ 1 - 1
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,

+ 5 - 5
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";

+ 1 - 1
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";
 

+ 1 - 1
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";
 

+ 0 - 0
web/apps/photos/src/utils/storage/mlIDbStorage.ts → web/apps/photos/src/services/ml/db.ts


+ 1 - 1
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";

+ 1 - 1
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",