Improve Beats searches massively, increase timeout because it is slow as balls

This commit is contained in:
Jonathan Cremin 2014-12-11 21:51:14 +00:00
parent ce3ff0442c
commit 2d9f8d1b6a
3 changed files with 5 additions and 3 deletions

View file

@ -100,10 +100,10 @@ module.exports.search = function(data) {
var type = data.type;
if (type == "album") {
query = data.artist.name + " " + data.name;
query = '"' + data.artist.name + '" "' + data.name + '"';
album = data.name;
} else if (type == "track") {
query = data.artist.name + " " + data.album.name + " " + data.name;
query = '"' + data.artist.name + '" "' + data.name + '"';
album = data.album.name
}
@ -123,6 +123,8 @@ module.exports.search = function(data) {
deferred.resolve({service: "beats"});
}
} else {
//insist on at least album or artist name being exactly right
module.exports.lookupId(res.body.data[0].id, type).then(deferred.resolve);
}
});