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