Artst images now an array of objects for better gallery support (needs testing)

This commit is contained in:
James Barnsley
2018-10-29 16:24:04 +13:00
parent ba1d4295e5
commit ec56a7a67f
11 changed files with 13798 additions and 10490 deletions

View File

@ -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){

View File

@ -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));
}
}
})