Fix spotify searches with no results
This commit is contained in:
parent
9dd87c8d18
commit
8bcb13a7a9
2 changed files with 2 additions and 4 deletions
|
@ -26,8 +26,6 @@ module.exports.lookupId = function(id, type, cc) {
|
|||
path = "/" + cc + path;
|
||||
}
|
||||
|
||||
console.log(path)
|
||||
|
||||
request.get(apiRoot + path, function(res) {
|
||||
var data = JSON.parse(res.text);
|
||||
|
||||
|
|
|
@ -69,13 +69,13 @@ module.exports.search = function(data) {
|
|||
album = data.album.name;
|
||||
}
|
||||
|
||||
spotify.search({query: query, type: type}, function(err, data) {
|
||||
spotify.search({query: query, type: type}, function(err, results) {
|
||||
if ( err ) {
|
||||
deferred.resolve({service: "spotify"});
|
||||
return;
|
||||
}
|
||||
|
||||
if (!data[type + "s"].items[0]) {
|
||||
if (!results[type + "s"].items[0]) {
|
||||
var matches = album.match(/^[^\(\[]+/);
|
||||
if (matches[0] && matches[0] != album) {
|
||||
var cleanedData = JSON.parse(JSON.stringify(data));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue