Lazy-loading album tracks, fixes #484

This commit is contained in:
James Barnsley
2020-02-14 10:55:10 +13:00
parent 75ebcace4c
commit 69b1c7361a
8 changed files with 58 additions and 25 deletions

View File

@ -502,7 +502,7 @@ export function getURL(url, action_name, key = false) {
};
}
export function getMore(url, core_action = null, custom_action = null) {
export function getMore(url, core_action = null, custom_action = null, extra_data = {}) {
return (dispatch, getState) => {
request(dispatch, getState, url)
.then(
@ -513,6 +513,7 @@ export function getMore(url, core_action = null, custom_action = null) {
core_action.parent_key,
core_action.records_type,
response,
extra_data,
));
} else if (custom_action) {
custom_action.data = response;
@ -1301,7 +1302,6 @@ export function getAlbum(uri) {
const tracks = Object.assign([], response.tracks.items);
const album = {
...helpers.formatAlbum(response),
artists_uris: helpers.arrayOf('uri', response.artists),
tracks_uris: helpers.arrayOf('uri', tracks),