Loading partial artists
This commit is contained in:
@ -224,11 +224,13 @@ export function getTrack(uri){
|
||||
}
|
||||
|
||||
export function getArtist(uri, artist, mbid = false){
|
||||
|
||||
return (dispatch, getState) => {
|
||||
if (mbid){
|
||||
var params = 'method=artist.getInfo&mbid='+mbid
|
||||
} else {
|
||||
artist = encodeURIComponent(artist );
|
||||
artist = artist.replace("&","and");
|
||||
artist = encodeURIComponent(artist);
|
||||
var params = 'method=artist.getInfo&artist='+artist
|
||||
}
|
||||
sendRequest(dispatch, getState, params)
|
||||
|
||||
@ -1684,7 +1684,7 @@ const MopidyMiddleware = (function(){
|
||||
if (artist.musicbrainz_id){
|
||||
store.dispatch(lastfmActions.getArtist(artist.uri, false, artist.musicbrainz_id ) )
|
||||
} else {
|
||||
store.dispatch(lastfmActions.getArtist(artist.uri, artist.name.replace('&','and') ) )
|
||||
store.dispatch(lastfmActions.getArtist(artist.uri, artist.name))
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1708,8 +1708,13 @@ const MopidyMiddleware = (function(){
|
||||
);
|
||||
artists.push(artist);
|
||||
|
||||
if (!artist.images){
|
||||
store.dispatch(lastfmActions.getArtist(artist.uri, artist.name));
|
||||
// load artwork from LastFM
|
||||
if (!artist.images || artist.images.length <= 0){
|
||||
if (artist.musicbrainz_id){
|
||||
store.dispatch(lastfmActions.getArtist(artist.uri, false, artist.musicbrainz_id ) )
|
||||
} else {
|
||||
store.dispatch(lastfmActions.getArtist(artist.uri, artist.name))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user