fix: instant search via frontend library cache — no Go calls at all
The HTTP endpoint approach still crashed due to Wails asset server issues. Replaced with a pure frontend solution: searchLibraryCache() does a substring match against the libraryStore's cached artists and albums arrays. This is pure JS — zero Go calls, zero RPC, zero network — guaranteed instant. Results appear immediately as the user types. The full MB+LB search pipeline still runs via Wails RPC and replaces the library matches with richer results when done. Added cachedArtists/cachedAlbums getters to LibraryStore for synchronous read-only access to the already-loaded data. Removed the /api/search-local HTTP handler from the backend.
This commit is contained in:
@@ -118,9 +118,6 @@ func NewYellowJacketApp(
|
||||
yjApp.assetHandler.RegisterHandler("/artist-images/", artistImgHandler)
|
||||
}
|
||||
|
||||
// Register local search endpoint — bypasses Wails RPC serialization.
|
||||
yjApp.assetHandler.RegisterHandler("/api/search-local", yjApp.explore.SearchLocalHandler())
|
||||
|
||||
// create playlist service
|
||||
yjApp.playlist = playlist.NewService(
|
||||
yjApp.logger, yjApp.database, yjApp.appConfig,
|
||||
|
||||
Reference in New Issue
Block a user