mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
parent
696aec33e9
commit
030b318a9c
1 changed files with 12 additions and 8 deletions
|
@ -194,15 +194,19 @@ impl Metadata for Artist {
|
||||||
fn parse(msg: &Self::Message, session: &Session) -> Self {
|
fn parse(msg: &Self::Message, session: &Session) -> Self {
|
||||||
let country = session.country();
|
let country = session.country();
|
||||||
|
|
||||||
let top_tracks = msg.get_top_track()
|
let top_tracks: Vec<SpotifyId> = match msg.get_top_track()
|
||||||
.iter()
|
.iter()
|
||||||
.find(|tt| !tt.has_country() || countrylist_contains(tt.get_country(), &country))
|
.find(|tt| !tt.has_country() || countrylist_contains(tt.get_country(), &country)) {
|
||||||
.unwrap()
|
Some(tracks) => {
|
||||||
.get_track()
|
tracks.get_track()
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|track| track.has_gid())
|
.filter(|track| track.has_gid())
|
||||||
.map(|track| SpotifyId::from_raw(track.get_gid()))
|
.map(|track| SpotifyId::from_raw(track.get_gid()))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>()
|
||||||
|
},
|
||||||
|
None => Vec::new()
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
Artist {
|
Artist {
|
||||||
id: SpotifyId::from_raw(msg.get_gid()),
|
id: SpotifyId::from_raw(msg.get_gid()),
|
||||||
|
|
Loading…
Reference in a new issue