Debugging Spotify API outage

This commit is contained in:
James Barnsley
2017-12-04 07:58:48 +13:00
parent 31f9461984
commit dfde8d8cf9
2 changed files with 5 additions and 4 deletions

View File

@ -66,7 +66,7 @@ class App extends React.Component{
// Check for url-parsed configuration values
var url_vars = this.props.location.query;
if (url_vars !== undefined){
if (url_vars !== undefined && url_vars.host !== undefined && url_vars.port !== undefined){
this.props.mopidyActions.setConfig(url_vars);
hashHistory.push(global.baseURL);
}

View File

@ -35,7 +35,8 @@ const sendRequest = (dispatch, getState, endpoint, method = 'GET', data = false)
cached: true,
timeout: 30000,
headers: {
Authorization: 'Bearer '+ response
Authorization: 'Bearer '+ response,
Accept: 'application/json'
}
}
@ -330,9 +331,9 @@ export function getFeaturedPlaylists(){
var sec = date.getSeconds();
if (sec < 10 ) sec = '0'+sec;
var timestamp = year+'-'+month+'-'+day+'T'+hour+':'+min+':'+sec;
var timestamp = year+'-'+month+'-'+day+'T'+hour+':00:00';
sendRequest(dispatch, getState, 'browse/featured-playlists?timestamp='+timestamp+'&country='+getState().core.country+'&limit=50&locale='+getState().core.locale )
sendRequest(dispatch, getState, 'browse/featured-playlists?limit=50&country='+getState().core.country+'&locale='+getState().core.locale+'timestamp='+timestamp)
.then(
response => {
var playlists = []