fix(reco): route Recommendations MusicBrainz lookups through the core client

recommendations_qt and external_reco_qt built private MusicBrainzClient
instances, which start enabled and ignore the musicbrainz_enabled
opt-out that integrations_qt applies to the core's client. Expose the
core's Arc<MusicBrainzClient> and borrow it instead, so a disabled
MusicBrainz sends zero requests from Discover > Recommendations. The tag
editor's three private clients stay: those are explicit manual lookups
the user triggers by hand.

cc
This commit is contained in:
vicrodh committed 2026-08-28 19:54:47 -06:00
1 parent 136f4d77ad
commit 924af24e91
3 files changed
+18 -6

No files matched your search

+8
View File
@@ -2243,6 +2243,14 @@ impl<A: FrontendAdapter + Send + Sync + 'static> QbzCore<A> {
self.musicbrainz.set_enabled(enabled).await;
}
/// The core's shared MusicBrainz client — the ONE instance whose enabled
/// flag `musicbrainz_set_enabled` toggles. Frontend code that needs a
/// client must borrow this one: a private `MusicBrainzClient::new()`
/// starts enabled and silently ignores the user's opt-out.
pub fn musicbrainz_client(&self) -> Arc<MusicBrainzClient> {
Arc::clone(&self.musicbrainz)
}
/// Resolve an artist name to a MusicBrainz id. Returns `None` if no
/// confident match is found.
pub async fn musicbrainz_resolve_artist(