Skip to content

armgit / ente

Public Imported from GitHub
0

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

Use the same source

Manav Rathicc0dea5c342f
diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.ts
index 8a28ba7bb7..1be9f1f700 100644
--- a/web/packages/new/photos/services/ml/index.ts
+++ b/web/packages/new/photos/services/ml/index.ts
@@ -58,7 +58,6 @@ const worker = async () => {
const createComlinkWorker = async () => {
const electron = ensureElectron();
const mlWorkerElectron = {
- appVersion: electron.appVersion,
detectFaces: electron.detectFaces,
computeFaceEmbeddings: electron.computeFaceEmbeddings,
computeCLIPImageEmbedding: electron.computeCLIPImageEmbedding,
diff --git a/web/packages/new/photos/services/ml/worker-types.ts b/web/packages/new/photos/services/ml/worker-types.ts
index 2e30703844..1eb43933a3 100644
--- a/web/packages/new/photos/services/ml/worker-types.ts
+++ b/web/packages/new/photos/services/ml/worker-types.ts
@@ -12,7 +12,6 @@
* {@link Electron} that are needed by the code running in the ML web worker.
*/
export interface MLWorkerElectron {
- appVersion: () => Promise<string>;
detectFaces: (input: Float32Array) => Promise<Float32Array>;
computeFaceEmbeddings: (input: Float32Array) => Promise<Float32Array>;
computeCLIPImageEmbedding: (input: Float32Array) => Promise<Float32Array>;
diff --git a/web/packages/new/photos/services/ml/worker.ts b/web/packages/new/photos/services/ml/worker.ts
index 7b4e70a54d..bd0860b95d 100644
--- a/web/packages/new/photos/services/ml/worker.ts
+++ b/web/packages/new/photos/services/ml/worker.ts
@@ -69,7 +69,6 @@ interface IndexableItem {
export class MLWorker {
private electron: MLWorkerElectron | undefined;
private delegate: MLWorkerDelegate | undefined;
- private userAgent: string | undefined;
private state: "idle" | "indexing" = "idle";
private liveQ: IndexableItem[] = [];
private idleTimeout: ReturnType<typeof setTimeout> | undefined;
@@ -91,8 +90,6 @@ export class MLWorker {
async init(electron: MLWorkerElectron, delegate?: MLWorkerDelegate) {
this.electron = electron;
this.delegate = delegate;
- // Set the user agent that'll be set in the generated embeddings.
- this.userAgent = `${clientPackageName}/${await electron.appVersion()}`;
// Initialize the downloadManager running in the web worker with the
// user's token. It'll be used to download files to index if needed.
await downloadManager.init(await ensureAuthToken());
@@ -181,7 +178,6 @@ export class MLWorker {
const allSuccess = await indexNextBatch(
items,
ensure(this.electron),
- ensure(this.userAgent),
this.delegate,
);
if (allSuccess) {
@@ -241,7 +237,6 @@ expose(MLWorker);
const indexNextBatch = async (
items: IndexableItem[],
electron: MLWorkerElectron,
- userAgent: string,
delegate: MLWorkerDelegate | undefined,
) => {
// Don't try to index if we wouldn't be able to upload them anyway. The
@@ -259,7 +254,7 @@ const indexNextBatch = async (
let allSuccess = true;
for (const item of items) {
try {
- await index(item, electron, userAgent);
+ await index(item, electron);
delegate?.workerDidProcessFile();
// Possibly unnecessary, but let us drain the microtask queue.
await wait(0);
@@ -359,7 +354,6 @@ const syncWithLocalFilesAndGetFilesToIndex = async (
const index = async (
{ enteFile, uploadItem, remoteDerivedData }: IndexableItem,
electron: MLWorkerElectron,
- userAgent: string,
) => {
const f = fileLogID(enteFile);
const fileID = enteFile.id;
@@ -453,13 +447,13 @@ const index = async (
const remoteFaceIndex = existingRemoteFaceIndex ?? {
version: faceIndexingVersion,
- client: userAgent,
+ client: clientPackageName,
...faceIndex,
};
const remoteCLIPIndex = existingRemoteCLIPIndex ?? {
version: clipIndexingVersion,
- client: userAgent,
+ client: clientPackageName,
...clipIndex,
};