Skip to content

armgit / ente

Public Imported from GitHub
0

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

Percentage during clustering

Manav Rathi3324019b3874
diff --git a/web/packages/new/photos/components/MLSettings.tsx b/web/packages/new/photos/components/MLSettings.tsx
index 6158387a80..29a99aa19c 100644
--- a/web/packages/new/photos/components/MLSettings.tsx
+++ b/web/packages/new/photos/components/MLSettings.tsx
@@ -315,14 +315,19 @@ const ManageML: React.FC<ManageMLProps> = ({
status = t("indexing_status_running");
break;
case "clustering":
- // TODO-Cluster
status = t("people");
break;
default:
status = t("indexing_status_done");
break;
}
- const processed = `${nSyncedFiles} / ${nTotalFiles}`;
+
+ // When clustering, show the progress as a percentage instead of the
+ // potentially confusing total counts during incremental updates.
+ const processed =
+ phase == "clustering"
+ ? `${Math.round((100 * nSyncedFiles) / nTotalFiles)}`
+ : `${nSyncedFiles} / ${nTotalFiles}`;
const confirmDisableML = () => {
setDialogBoxAttributesV2({
diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.ts
index cb75242f4f..04bb7f7347 100644
--- a/web/packages/new/photos/services/ml/index.ts
+++ b/web/packages/new/photos/services/ml/index.ts
@@ -403,8 +403,8 @@ export type MLStatus =
| { phase: "disabled" /* The ML remote flag is off */ }
| {
/**
- * Which phase we are in within the indexing pipeline when viewed across the
- * user's entire library:
+ * Which phase we are in within the indexing pipeline when viewed
+ * across the user's entire library:
*
* - "scheduled": A ML job is scheduled. Likely there are files we
* know of that have not been indexed, but is also the state before
@@ -415,11 +415,11 @@ export type MLStatus =
* - "fetching": The indexer is currently running, but we're primarily
* fetching indexes for existing files.
*
- * - "clustering": All file we know of have been indexed, and we are now
- * clustering the faces that were found.
+ * - "clustering": All files we know of have been indexed, and we are
+ * now clustering the faces that were found.
*
- * - "done": ML indexing and face clustering is complete for the user's
- * library.
+ * - "done": ML indexing and face clustering is complete for the
+ * user's library.
*/
phase: "scheduled" | "indexing" | "fetching" | "clustering" | "done";
/** The number of files that have already been indexed. */