the main trick here is to wait until we're done getting responses to our last.fm api requests before we start kicking off spotify requests and building playlist dropdowns with event handlers and templating code that requires last.fm data in order to function.
note that this means that the playlist dropdown will now be empty for several seconds until our last.fm history has been processed. this could be mitigated by:
disabling the dropdown until it's been populated and having it say "please wait" or something, then (in an else clause of the if(response.next) if statement in the success function in getPlaylistTracks()?) enabling it once we're done processing spotify api respones
(eventually!) using localstorage to cache last.fm history so that the app initializes relatively instantly after the first pageload instead of always fetching the entire 4-week last.fm history
i've clicked around and verified that the app looks sane locally on my machine, but you know it better than i do - if i missed anything, or if my approach seems insane, or if you see bugs or have feedback / etc, please say so!
the main trick here is to wait until we're done getting responses to our last.fm api requests before we start kicking off spotify requests and building playlist dropdowns with event handlers and templating code that requires last.fm data in order to function.
note that this means that the playlist dropdown will now be empty for several seconds until our last.fm history has been processed. this could be mitigated by:
else
clause of theif(response.next)
if statement in thesuccess
function ingetPlaylistTracks()
?) enabling it once we're done processing spotify api responesi've clicked around and verified that the app looks sane locally on my machine, but you know it better than i do - if i missed anything, or if my approach seems insane, or if you see bugs or have feedback / etc, please say so!