feat(reco): per-user artist-vector store lifecycle (T7)

Open the per-user ArtistVectorStore (<user>/cache/artist_vectors.db) and install
it on the core (core.set_artist_vectors) at the three session-activation sites
(login, restore, offline entry), next to the sub-plan-1 reco init; drop it on
logout (core.clear_artist_vectors). The store is core-owned (no bin-side static),
so the suggestions engine reads/writes it through QbzCore. Adds qbz-reco as a bin
dependency.

cc
This commit is contained in:
vicrodh committed 2026-06-26 21:04:23 -06:00
1 parent 9cc44f5d1d
commit 49a78c2ca0
4 files changed
+17

No files matched your search

+1
View File
@@ -5433,6 +5433,7 @@ dependencies = [
"qbz-playlist-import",
"qbz-plex",
"qbz-qobuz",
"qbz-reco",
"qbz-slint-common",
"qbz-text-utils",
"qbz-theme",
+1
View File
@@ -69,6 +69,7 @@ qbz-theme = { path = "../qbz-theme" }
qbz-media-controls = { path = "../qbz-media-controls" }
qbz-audio = { path = "../qbz-audio" }
qbz-core = { path = "../qbz-core" }
qbz-reco = { path = "../qbz-reco" }
qbz-player = { path = "../qbz-player" }
qbz-cast = { path = "../qbz-cast" }
qconnect-app = { path = "../qconnect-app" }
+11
View File
@@ -114,6 +114,11 @@ where
// after init (off-thread) so the seeds reflect this session's events.
crate::reco::init_for_user(&dir);
crate::reco::train_async();
// Playlist Suggested Songs: open the per-user artist-vector store on
// the core (the suggestions engine reads/writes it).
if let Ok(store) = qbz_reco::ArtistVectorStore::open_at(&dir) {
runtime.core().set_artist_vectors(store).await;
}
crate::discover_prefs::init_for_user(&dir);
crate::artist_blacklist::init_for_user(&dir);
// Intelligent Search (cache + ranking), seeded from the persisted pref.
@@ -235,6 +240,11 @@ where
// session's events.
crate::reco::init_for_user(&dir);
crate::reco::train_async();
// Playlist Suggested Songs: open the per-user artist-vector
// store on the core (the suggestions engine reads/writes it).
if let Ok(store) = qbz_reco::ArtistVectorStore::open_at(&dir) {
runtime.core().set_artist_vectors(store).await;
}
crate::discover_prefs::init_for_user(&dir);
crate::artist_blacklist::init_for_user(&dir);
// Intelligent Search (cache + ranking), seeded from the pref.
@@ -289,6 +299,7 @@ where
crate::offline_mode::teardown();
crate::fav_cache::teardown();
crate::reco::teardown();
runtime.core().clear_artist_vectors().await;
crate::discover_prefs::teardown();
crate::artist_blacklist::teardown();
crate::search_service::teardown();
+4
View File
@@ -519,6 +519,10 @@ async fn enter_shell_offline(
crate::fav_cache::init_for_user(&dir);
// Recommendation event store (shared events.db with Tauri).
crate::reco::init_for_user(&dir);
// Playlist Suggested Songs: open the per-user artist-vector store.
if let Ok(store) = qbz_reco::ArtistVectorStore::open_at(&dir) {
runtime.core().set_artist_vectors(store).await;
}
crate::discover_prefs::init_for_user(&dir);
// D-FIX-a: bind the blacklist offline too — Tauri never initialized it
// in offline mode, so blacklisted artists leaked into offline surfaces.