Skip to content

armgit / ente

Public Imported from GitHub
0

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

Try to find a split point

Manav Rathif692638eded7
diff --git a/web/apps/photos/src/services/face/db.ts b/web/apps/photos/src/services/face/db.ts
index 3c6999e681..544e792dce 100644
--- a/web/apps/photos/src/services/face/db.ts
+++ b/web/apps/photos/src/services/face/db.ts
@@ -24,6 +24,15 @@ export interface IndexStatus {
peopleIndexSynced: boolean;
}
+/**
+ * TODO(MR): Transient type with an intersection of values that both existing
+ * and new types during the migration will have. Eventually we'll store the the
+ * server ML data shape here exactly.
+ */
+export interface MinimalFileData {
+ mlVersion: number;
+}
+
interface Config {}
export const ML_SEARCH_CONFIG_NAME = "ml-search";
diff --git a/web/apps/photos/src/services/machineLearning/machineLearningService.ts b/web/apps/photos/src/services/machineLearning/machineLearningService.ts
index a290acb74b..87d5656d0b 100644
--- a/web/apps/photos/src/services/machineLearning/machineLearningService.ts
+++ b/web/apps/photos/src/services/machineLearning/machineLearningService.ts
@@ -316,7 +316,7 @@ class MachineLearningService {
}
private async syncFile(enteFile: EnteFile, localFile?: globalThis.File) {
- const oldMlFile = await this.getMLFileData(enteFile.id);
+ const oldMlFile = await mlIDbStorage.getFile(enteFile.id);
if (oldMlFile && oldMlFile.mlVersion) {
return oldMlFile;
}
@@ -327,10 +327,6 @@ class MachineLearningService {
return newMlFile;
}
- private async getMLFileData(fileId: number) {
- return mlIDbStorage.getFile(fileId);
- }
-
private async persistMLFileSyncError(enteFile: EnteFile, e: Error) {
try {
await mlIDbStorage.upsertFileInTx(enteFile.id, (mlFileData) => {