Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Move

Manav Rathi3c92349054f9
diff --git a/web/apps/photos/src/components/ml/PeopleList.tsx b/web/apps/photos/src/components/ml/PeopleList.tsx
index def73dffd5..d44d100612 100644
--- a/web/apps/photos/src/components/ml/PeopleList.tsx
+++ b/web/apps/photos/src/components/ml/PeopleList.tsx
@@ -3,7 +3,7 @@ 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/face/db-old";
+import { unidentifiedFaceIDs } from "services/face/indexer";
import type { Person } from "services/face/people";
import { EnteFile } from "types/file";
@@ -143,10 +143,3 @@ const FaceCropImageView: React.FC<FaceCropImageViewProps> = ({ faceID }) => {
<Skeleton variant="circular" height={120} width={120} />
);
};
-
-const unidentifiedFaceIDs = async (
- file: EnteFile,
-): Promise<{ id: string }[]> => {
- const mlFileData = await mlIDbStorage.getFile(file.id);
- return mlFileData?.faces;
-};
diff --git a/web/apps/photos/src/services/face/indexer.ts b/web/apps/photos/src/services/face/indexer.ts
index 90252720fc..5d5d0f56c5 100644
--- a/web/apps/photos/src/services/face/indexer.ts
+++ b/web/apps/photos/src/services/face/indexer.ts
@@ -186,7 +186,7 @@ export const faceIndexingStatus = async (): Promise<FaceIndexingStatus> => {
return indexStatus;
};
-export const convertToNewInterface = (indexStatus: IndexStatus) => {
+const convertToNewInterface = (indexStatus: IndexStatus) => {
let phase: FaceIndexingStatus["phase"];
if (!indexStatus.localFilesSynced) {
phase = "scheduled";
@@ -202,3 +202,14 @@ export const convertToNewInterface = (indexStatus: IndexStatus) => {
phase,
};
};
+
+/**
+ * Return the IDs of all the faces in the given {@link enteFile} that are not
+ * associated with a person cluster.
+ */
+export const unidentifiedFaceIDs = async (
+ enteFile: EnteFile,
+): Promise<{ id: string }[]> => {
+ const mlFileData = await mlIDbStorage.getFile(enteFile.id);
+ return mlFileData?.faces ?? [];
+};