Backend functional, just need to tidy UI

This commit is contained in:
James Barnsley
2018-01-12 09:08:12 +13:00
parent 59e751eea9
commit c4c3ecf45e
8 changed files with 405 additions and 50 deletions

View File

@ -873,7 +873,7 @@ export function getFavorites(limit = 50, term = 'long_term'){
*
* @param uris = array of artist or track URIs or a genre string
**/
export function getRecommendations(uris = [], limit = 20){
export function getRecommendations(uris = [], limit = 20, tunabilities = null){
return (dispatch, getState) => {
dispatch({type: 'CLEAR_SPOTIFY_RECOMMENDATIONS'});
@ -913,6 +913,16 @@ export function getRecommendations(uris = [], limit = 20){
endpoint += '&seed_genres='+genres.join(',')
endpoint += '&limit='+limit
console.log(tunabilities);
if (tunabilities){
for (var key in tunabilities){
if (tunabilities.hasOwnProperty(key)){
endpoint += '&'+key+'='+tunabilities[key];
}
}
}
sendRequest(dispatch, getState, endpoint)
.then(
response => {