feat(discover): add get_dynamic_suggest_full carrying track_to_analysed
Tauri's DailyQ/WeeklyQ /dynamic/suggest seeds a track_to_analysed payload
(~9 resolved {track_id,artist_id,genre_id,label_id} tuples) for the PRIMARY
mix algorithm; the empty-analysis call is only its fallback. The Slint port
only ever sent the empty-analysis path. Add a TrackToAnalyse model
(qbz-models) and a get_dynamic_suggest_full method on the qobuz client and
qbz-core that carries the payload; the existing get_dynamic_suggest now
delegates with an empty analysis (behaviour unchanged). Plumbing only — the
mix.rs build of the analysis tuples + the two-call fallback lands next (a2).
cc
This commit is contained in:
4 files changed
+47
-3
No files matched your search
@@ -12,8 +12,8 @@ use qbz_models::{
|
||||
LabelListPage, LabelPageData, LabelStoryResponse, PageArtistResponse,
|
||||
MostPopularItem, Playlist, PlaylistDuplicateResult, PlaylistTag, Quality, QueueState,
|
||||
QueueTrack, ReleasesGridResponse,
|
||||
RepeatMode, SearchAllResults, SearchResultsPage, StreamUrl, Track, TracksContainer,
|
||||
UserSession,
|
||||
RepeatMode, SearchAllResults, SearchResultsPage, StreamUrl, Track, TrackToAnalyse,
|
||||
TracksContainer, UserSession,
|
||||
};
|
||||
use qbz_integrations::musicbrainz::cache::MusicBrainzCache;
|
||||
use qbz_integrations::musicbrainz::genre::{extract_affinity_seeds, genre_summary, is_broad_genre};
|
||||
@@ -1319,6 +1319,22 @@ impl<A: FrontendAdapter + Send + Sync + 'static> QbzCore<A> {
|
||||
.map_err(CoreError::Api)
|
||||
}
|
||||
|
||||
/// Dynamic mix suggestions with the `track_to_analysed` payload — the
|
||||
/// PRIMARY DailyQ/WeeklyQ path (see `QobuzClient::get_dynamic_suggest_full`).
|
||||
pub async fn get_dynamic_suggest_full(
|
||||
&self,
|
||||
listened_track_ids: &[u64],
|
||||
tracks_to_analyse: &[TrackToAnalyse],
|
||||
limit: u32,
|
||||
) -> Result<Vec<Track>, CoreError> {
|
||||
let client = self.client.read().await;
|
||||
let client = client.as_ref().ok_or(CoreError::NotInitialized)?;
|
||||
client
|
||||
.get_dynamic_suggest_full(listened_track_ids, tracks_to_analyse, limit)
|
||||
.await
|
||||
.map_err(CoreError::Api)
|
||||
}
|
||||
|
||||
/// Smart artist radio via the local `qbz-radio` pool builder — a
|
||||
/// richer alternative to the Qobuz `/radio/artist` endpoint. Builds
|
||||
/// a session pool (seed tracks + similar artists + second-degree)
|
||||
|
||||
Reference in new issue
Block a user