Headings on responsive (flex); GridItem trigger image load

This commit is contained in:
James Barnsley
2019-09-15 21:11:57 +12:00
parent 5688b29ae9
commit 6415074287
18 changed files with 197 additions and 76 deletions

View File

@ -1177,6 +1177,29 @@ export function getArtists(uris) {
};
}
// Used to get images for non-Spotify artists
export function getArtistImages(artist) {
return (dispatch, getState) => {
request(dispatch, getState, `search?q=${artist.name}&type=artist`)
.then(response => {
if (response.artists.items) {
const updatedArtist = {
uri: artist.uri,
images: response.artists.items[0].images,
}
dispatch(coreActions.artistLoaded(updatedArtist));
}
},
error => {
dispatch(coreActions.handleException(
'Could not load artists',
error,
));
},
);
};
}
export function playArtistTopTracks(uri) {
return (dispatch, getState) => {