refactor(v2): migrate get_artist_tracks to v2
Path C: legacy command called client.get_artist_tracks (the /artist/get?extra=tracks path) and returned a TracksContainer. No existing v2 equivalent, so add v2_get_artist_tracks via QbzCore -> QobuzClient::get_artist_tracks directly. cc
This commit is contained in:
5 files changed
+65
-4
No files matched your search
@@ -11,7 +11,7 @@ use qbz_models::{
|
||||
DiscoverResponse, FrontendAdapter, GenreInfo, LabelExploreResponse, LabelGetListResponse,
|
||||
LabelListPage, LabelPageData, LabelStoryResponse, PageArtistResponse,
|
||||
Playlist, PlaylistTag, Quality, QueueState, QueueTrack, RepeatMode, SearchResultsPage,
|
||||
StreamUrl, Track, UserSession,
|
||||
StreamUrl, Track, TracksContainer, UserSession,
|
||||
};
|
||||
use qbz_player::{PlaybackState, Player, QueueManager};
|
||||
use qbz_qobuz::QobuzClient;
|
||||
@@ -886,6 +886,22 @@ impl<A: FrontendAdapter + Send + Sync + 'static> QbzCore<A> {
|
||||
.map_err(CoreError::Api)
|
||||
}
|
||||
|
||||
/// Get an artist's popular/top tracks (`/artist/get?extra=tracks`).
|
||||
pub async fn get_artist_tracks(
|
||||
&self,
|
||||
artist_id: u64,
|
||||
limit: u32,
|
||||
offset: u32,
|
||||
) -> Result<TracksContainer, CoreError> {
|
||||
let client = self.client.read().await;
|
||||
let client = client.as_ref().ok_or(CoreError::NotInitialized)?;
|
||||
|
||||
client
|
||||
.get_artist_tracks(artist_id, limit, offset)
|
||||
.await
|
||||
.map_err(CoreError::Api)
|
||||
}
|
||||
|
||||
/// Get label page (aggregated: top tracks, releases, playlists, artists)
|
||||
pub async fn get_label_page(&self, label_id: u64) -> Result<LabelPageData, CoreError> {
|
||||
let client = self.client.read().await;
|
||||
|
||||
Reference in new issue
Block a user