You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add rate limiting and export progress tracking [#12]
* Implement rate limiting using Retry-After header
- Remove jQuery in exporter objects
- Use Bottleneck library for rate limiting https://github.com/SGrondin/bottleneck
- Simplify code
* Add progress bar for Export All progress
* Update tests to ensure access token is correctly passed
// Show library of saved tracks if viewing first page
55
53
if(firstPage){
@@ -65,46 +63,68 @@ class PlaylistTable extends React.Component {
65
63
},
66
64
"tracks": {
67
65
"href": "https://api.spotify.com/v1/me/tracks",
68
-
"limit": args[0][0].limit,
69
-
"total": args[0][0].total
66
+
"limit": likedTracksResponse.limit,
67
+
"total": likedTracksResponse.total
70
68
},
71
69
"uri": "spotify:user:"+userId+":saved"
72
70
});
73
71
74
72
// FIXME: Handle unmounting
75
73
this.setState({
76
-
likedSongsLimit: args[0][0].limit,
77
-
likedSongsCount: args[0][0].total
74
+
likedSongs: {
75
+
limit: likedTracksResponse.limit,
76
+
count: likedTracksResponse.total
77
+
}
78
78
})
79
79
}
80
80
81
81
// FIXME: Handle unmounting
82
82
this.setState({
83
83
playlists: playlists,
84
-
playlistCount: response.total,
85
-
nextURL: response.next,
86
-
prevURL: response.previous
84
+
playlistCount: playlistsResponse.total,
85
+
nextURL: playlistsResponse.next,
86
+
prevURL: playlistsResponse.previous
87
87
});
88
88
89
89
$('#playlists').fadeIn();
90
-
$('#subtitle').text((response.offset+1)+'-'+(response.offset+response.items.length)+' of '+response.total+' playlists for '+userId)
90
+
$('#subtitle').text((playlistsResponse.offset+1)+'-'+(playlistsResponse.offset+playlistsResponse.items.length)+' of '+playlistsResponse.total+' playlists for '+userId)
0 commit comments