Updated PLAYLISTS_LOADING
This commit is contained in:
@ -262,22 +262,23 @@ export function getFeaturedPlaylists(){
|
|||||||
|
|
||||||
sendRequest( dispatch, getState, 'browse/featured-playlists?timestamp='+timestamp+'&country='+getState().spotify.country+'&limit=50&locale='+getState().spotify.locale )
|
sendRequest( dispatch, getState, 'browse/featured-playlists?timestamp='+timestamp+'&country='+getState().spotify.country+'&limit=50&locale='+getState().spotify.locale )
|
||||||
.then( response => {
|
.then( response => {
|
||||||
for (var i = 0; i < response.playlists.items.length; i++){
|
|
||||||
|
|
||||||
var playlist = response.playlists.items[i]
|
var playlists = []
|
||||||
Object.assign(
|
for (var i = 0; i < response.playlists.items.length; i++){
|
||||||
playlist,
|
playlists.push(Object.assign(
|
||||||
|
{},
|
||||||
|
response.playlists.items[i],
|
||||||
{
|
{
|
||||||
can_edit: (getState().spotify.me && playlist.owner.id == getState().spotify.me.id),
|
can_edit: (getState().spotify.me && response.playlists.items[i].owner.id == getState().spotify.me.id),
|
||||||
tracks_total: playlist.tracks.total
|
tracks_total: response.playlists.items[i].tracks.total
|
||||||
|
}
|
||||||
|
))
|
||||||
}
|
}
|
||||||
)
|
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'PLAYLIST_LOADED',
|
type: 'PLAYLISTS_LOADED',
|
||||||
playlist: playlist
|
playlists: playlists
|
||||||
});
|
});
|
||||||
}
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'SPOTIFY_FEATURED_PLAYLISTS_LOADED',
|
type: 'SPOTIFY_FEATURED_PLAYLISTS_LOADED',
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
Reference in New Issue
Block a user