Revert ML search (#50) to restore a green next (build fix pending)
check / check (push) Successful in 18s
check / check (push) Successful in 18s
Reverts the #50 merge (224bd101): mlsearch.ts failed tsc in the CI build (make check does not run make build, so it slipped past review). next restored to green; #50 to be redone with make build in its gate.
Model: opus-4-8
This commit was merged in pull request #69.
This commit is contained in:
+4
-12
@@ -41,7 +41,6 @@ import {
|
||||
type PhotosAPI,
|
||||
type TimelineAPI,
|
||||
} from "./read.js";
|
||||
import { makeMLDataAPI, type MLDataAPI } from "./mlsearch.js";
|
||||
|
||||
export {
|
||||
Album,
|
||||
@@ -53,7 +52,6 @@ export {
|
||||
type TimelineGroup,
|
||||
type GroupBy,
|
||||
} from "./read.js";
|
||||
export { type MLDataAPI, type SimilarResult } from "./mlsearch.js";
|
||||
import type { CollectionsPage, FilesPage } from "../client.js";
|
||||
import { MLDATA_BATCH_SIZE, type MLData } from "../mldata-fetch.js";
|
||||
import type { Collection, EnteFile } from "../model/types.js";
|
||||
@@ -140,10 +138,6 @@ export class Library {
|
||||
readonly albums: AlbumsAPI;
|
||||
readonly photos: PhotosAPI;
|
||||
readonly timeline: TimelineAPI;
|
||||
// The content-similarity search surface over the CLIP index (issue #50).
|
||||
// Present whether or not ML fetching is enabled; with no ML store it
|
||||
// returns empty results.
|
||||
readonly mldata: MLDataAPI;
|
||||
|
||||
private readonly client: LibraryClient;
|
||||
private readonly store: MetadataStore;
|
||||
@@ -152,7 +146,7 @@ export class Library {
|
||||
private readonly onProgress?: RefreshProgressCallback;
|
||||
private readonly pools: RequestPools;
|
||||
// The ML-data cache, present only when the client can fetch ML data.
|
||||
private readonly mlStore?: MLDataStore;
|
||||
private readonly mldata?: MLDataStore;
|
||||
|
||||
private timer?: ReturnType<typeof setTimeout>;
|
||||
private refreshing = false;
|
||||
@@ -194,7 +188,7 @@ export class Library {
|
||||
this.intervalMs = args.intervalMs;
|
||||
this.onProgress = args.onProgress;
|
||||
this.pools = args.pools;
|
||||
this.mlStore = args.mldata;
|
||||
this.mldata = args.mldata;
|
||||
this.lastRecords = this.deriveNow();
|
||||
|
||||
// The read namespaces derive fresh from the store on each call, so they
|
||||
@@ -203,8 +197,6 @@ export class Library {
|
||||
this.albums = makeAlbumsAPI(derive);
|
||||
this.photos = makePhotosAPI(derive);
|
||||
this.timeline = makeTimelineAPI(derive);
|
||||
// Reads the ML store live so results grow as ML data is fetched.
|
||||
this.mldata = makeMLDataAPI(() => this.mlStore);
|
||||
}
|
||||
|
||||
// Load the cache and start the refresh loop. With an empty cache the first
|
||||
@@ -301,7 +293,7 @@ export class Library {
|
||||
for (const c of collections) {
|
||||
files += this.store.listFiles(c.id).length;
|
||||
}
|
||||
const ml = this.mlStore?.stats();
|
||||
const ml = this.mldata?.stats();
|
||||
return {
|
||||
userID: this.store.userID,
|
||||
collections: collections.length,
|
||||
@@ -456,7 +448,7 @@ export class Library {
|
||||
// advanced), through the metadata pool, and update the CLIP index. Guarded
|
||||
// so passes never overlap; a failure is reported, not thrown.
|
||||
private async runMLFetch(): Promise<void> {
|
||||
const mldata = this.mlStore;
|
||||
const mldata = this.mldata;
|
||||
// Bind so the call keeps the client as its receiver when invoked
|
||||
// through the pool below.
|
||||
const fetchMLData = this.client.fetchMLData?.bind(this.client);
|
||||
|
||||
Reference in New Issue
Block a user