Implement browsing for albums, artists, playlists
This commit is contained in:
@@ -37,6 +37,7 @@ use std::sync::RwLock;
|
||||
use std::thread;
|
||||
use std::time::{Duration, SystemTime};
|
||||
|
||||
use artist::Artist;
|
||||
use config;
|
||||
use events::{Event, EventManager};
|
||||
use track::Track;
|
||||
@@ -571,6 +572,16 @@ impl Spotify {
|
||||
self.api_with_retry(|api| api.user_playlist_follow_playlist(&owner_id, &id, true))
|
||||
}
|
||||
|
||||
pub fn artist_top_tracks(&self, id: String) -> Option<Vec<Track>> {
|
||||
self.api_with_retry(|api| api.artist_top_tracks(&id, None))
|
||||
.map(|ft| ft.tracks.iter().map(|t| t.into()).collect())
|
||||
}
|
||||
|
||||
pub fn artist_related_artists(&self, id: String) -> Option<Vec<Artist>> {
|
||||
self.api_with_retry(|api| api.artist_related_artists(&id))
|
||||
.map(|fa| fa.artists.iter().map(|a| a.into()).collect())
|
||||
}
|
||||
|
||||
pub fn load(&self, track: &Track) {
|
||||
info!("loading track: {:?}", track);
|
||||
self.channel
|
||||
|
||||
Reference in New Issue
Block a user