Fixing add/remove track from library
This commit is contained in:
@ -632,6 +632,8 @@ class IrisCore(pykka.ThreadingActor):
|
||||
if (not added.get()):
|
||||
logger.error("No recommendations added to queue")
|
||||
|
||||
print added.get()
|
||||
|
||||
self.radio['enabled'] = 0;
|
||||
error = {
|
||||
'message': 'No recommendations added to queue',
|
||||
|
||||
@ -78939,28 +78939,19 @@ var request = function request(dispatch, getState, endpoint) {
|
||||
dispatch(uiActions.stopLoading(loader_key));
|
||||
|
||||
// TODO: Rate limiting
|
||||
if (response.status == 429) {
|
||||
alert('You hit the Spotify API rate limiter');
|
||||
if (response.status === 429) {
|
||||
console.error('You hit the Spotify API rate limiter');
|
||||
}
|
||||
|
||||
// Empty Response
|
||||
if (response.status == 204) {
|
||||
return Promise.resolve();
|
||||
|
||||
// Otherwise successful
|
||||
} else if (response.status >= 200 && response.status < 400) {
|
||||
return Promise.resolve(response.json());
|
||||
|
||||
// Not so successful
|
||||
} else {
|
||||
return Promise.reject(new Error(response.statusText));
|
||||
}
|
||||
return response.text().then(function (text) {
|
||||
return text ? JSON.parse(text) : {};
|
||||
});
|
||||
}
|
||||
|
||||
fetch(url, config).then(status).then(function (data) {
|
||||
// TODO: Instead of allowing request to fail before renewing the token, once refreshed
|
||||
// we should retry the original request(s)
|
||||
if (data && data.error && data.error.message == 'The access token expired') {
|
||||
if (data && data.error && data.error.message === 'The access token expired') {
|
||||
dispatch(refreshToken(dispatch, getState));
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -100,7 +100,7 @@
|
||||
|
||||
// Release details
|
||||
// These are automatically injected to built HTML
|
||||
var build = "1569276474";
|
||||
var build = "1569443683";
|
||||
var version = "3.40.0";
|
||||
|
||||
// Construct the script tag
|
||||
|
||||
@ -3,6 +3,8 @@ const blacklist = [
|
||||
'jamesbarnsley.co.nz',
|
||||
'following/contains',
|
||||
'followers/contains',
|
||||
'me/tracks',
|
||||
'me/albums',
|
||||
'refresh_spotify_token'
|
||||
];
|
||||
function inBlacklist(url) {
|
||||
|
||||
@ -57,22 +57,11 @@ const request = (dispatch, getState, endpoint, method = 'GET', data = false, cac
|
||||
dispatch(uiActions.stopLoading(loader_key));
|
||||
|
||||
// TODO: Rate limiting
|
||||
if (response.status == 429) {
|
||||
alert('You hit the Spotify API rate limiter');
|
||||
if (response.status === 429) {
|
||||
console.error('You hit the Spotify API rate limiter');
|
||||
}
|
||||
|
||||
// Empty Response
|
||||
if (response.status == 204) {
|
||||
return Promise.resolve();
|
||||
|
||||
// Otherwise successful
|
||||
} else if (response.status >= 200 && response.status < 400) {
|
||||
return Promise.resolve(response.json());
|
||||
|
||||
// Not so successful
|
||||
} else {
|
||||
return Promise.reject(new Error(response.statusText))
|
||||
}
|
||||
return response.text().then((text) => (text ? JSON.parse(text) : {}));
|
||||
}
|
||||
|
||||
fetch(url, config)
|
||||
@ -80,7 +69,7 @@ const request = (dispatch, getState, endpoint, method = 'GET', data = false, cac
|
||||
.then(data => {
|
||||
// TODO: Instead of allowing request to fail before renewing the token, once refreshed
|
||||
// we should retry the original request(s)
|
||||
if (data && data.error && data.error.message == 'The access token expired') {
|
||||
if (data && data.error && data.error.message === 'The access token expired') {
|
||||
dispatch(refreshToken(dispatch, getState));
|
||||
}
|
||||
|
||||
|
||||
@ -3,6 +3,8 @@ const blacklist = [
|
||||
'jamesbarnsley.co.nz',
|
||||
'following/contains',
|
||||
'followers/contains',
|
||||
'me/tracks',
|
||||
'me/albums',
|
||||
'refresh_spotify_token'
|
||||
];
|
||||
function inBlacklist(url) {
|
||||
|
||||
Reference in New Issue
Block a user