Skip to content

Commit

Permalink
Backend moved logging for #59
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbarrow committed Sep 22, 2017
1 parent 58960b2 commit 93cd97b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ function getSuggested(most_played, cb) {
genres.push(most_played[i].genres[Math.floor(Math.random() * most_played[i].genres.length)]);
}
request(API_ROOT + '/api/v2/GetSuggested/' + genres.join('|'), (error, response, body) => {
if (error || response.statusCode !== 200 || !body || body.error) return callback(true);
console.log(body)
if (error || response.statusCode !== 200 || !body || body.error) return cb(true);
try {
body = JSON.parse(body);
return cb(null, body);
} catch (error) {
return callback(true);
return cb(true);
}
});
}
Expand Down

0 comments on commit 93cd97b

Please sign in to comment.