This commit is contained in:
Manav Rathi 2024-05-18 08:07:49 +05:30
parent a7e6b1bf5b
commit 8edb506b29
No known key found for this signature in database
3 changed files with 3 additions and 20 deletions

View file

@ -9,7 +9,7 @@ import {
openDB,
} from "idb";
import isElectron from "is-electron";
import { Face, MLLibraryData, MlFileData, Person } from "services/face/types";
import { Face, MlFileData, Person } from "services/face/types";
import {
DEFAULT_ML_SEARCH_CONFIG,
MAX_ML_SYNC_ERROR_COUNT,
@ -50,7 +50,7 @@ interface MLDb extends DBSchema {
};
library: {
key: string;
value: MLLibraryData;
value: unknown;
};
configs: {
key: string;
@ -177,6 +177,7 @@ class MLIDbStorage {
ML_SEARCH_CONFIG_NAME,
);
db.deleteObjectStore("library");
db.deleteObjectStore("things");
} catch {
// TODO: ignore for now as we finalize the new version
@ -400,16 +401,6 @@ class MLIDbStorage {
return db.put("versions", version, index);
}
public async getLibraryData() {
const db = await this.db;
return db.get("library", "data");
}
public async putLibraryData(data: MLLibraryData) {
const db = await this.db;
return db.put("library", data, "data");
}
public async getConfig<T extends Config>(name: string, def: T) {
const db = await this.db;
const tx = db.transaction("configs", "readwrite");

View file

@ -1,4 +1,3 @@
import type { ClusterFacesResult } from "services/face/cluster";
import { Dimensions } from "services/face/geom";
import { EnteFile } from "types/file";
import { Box, Point } from "./geom";
@ -113,8 +112,4 @@ export interface MLSyncFileContext {
newAlignment?: boolean;
}
export interface MLLibraryData {
faceClusteringResults?: ClusterFacesResult;
}
export declare type MLIndex = "files" | "people";

View file

@ -13,7 +13,6 @@ import {
Face,
FaceDetection,
Landmark,
MLLibraryData,
MLSearchConfig,
MLSyncFileContext,
MlFileData,
@ -64,8 +63,6 @@ class MLSyncContext {
public error?: Error;
public mlLibraryData: MLLibraryData;
public syncQueue: PQueue;
// TODO: wheather to limit concurrent downloads
// private downloadQueue: PQueue;