Artst images now an array of objects for better gallery support (needs testing)
This commit is contained in:
@ -631,12 +631,11 @@ const CoreMiddleware = (function(){
|
||||
// Already have an artist in the index
|
||||
if (artists_index[artist.uri]){
|
||||
|
||||
// Don't replace existing images, instead add them as supplementary
|
||||
// this is to prevent LastFM overwriting Spotify images
|
||||
if (artists_index[artist.uri].images){
|
||||
artist.images_additional = artist.images;
|
||||
delete artist.images;
|
||||
}
|
||||
// And we've already got some images, make sure we merge the arrays,
|
||||
// rather than overwriting
|
||||
if (artists_index[artist.uri].images && artist.images){
|
||||
artist.images = [...artists_index[artist.uri].images, ...artist.images];
|
||||
}
|
||||
|
||||
artist = Object.assign({}, artists_index[artist.uri], artist);
|
||||
}
|
||||
@ -652,7 +651,6 @@ const CoreMiddleware = (function(){
|
||||
artists_loaded.push(artist);
|
||||
};
|
||||
|
||||
|
||||
action.artists = artists_loaded;
|
||||
|
||||
if (tracks_loaded.length > 0){
|
||||
|
||||
@ -2009,9 +2009,9 @@ const MopidyMiddleware = (function(){
|
||||
var existing_artist = store.getState().core.artists[artist.uri];
|
||||
if (existing_artist && !existing_artist.images){
|
||||
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 {
|
||||
store.dispatch(lastfmActions.getArtist(artist.uri, artist.name))
|
||||
store.dispatch(lastfmActions.getArtist(artist.uri, artist.name));
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user