diff --git a/lib/services/beats/index.js b/lib/services/beats/index.js index cf9ba5a..e4b51e4 100644 --- a/lib/services/beats/index.js +++ b/lib/services/beats/index.js @@ -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); } }); diff --git a/public/images/googleplaymusic.png b/public/images/google.png similarity index 100% rename from public/images/googleplaymusic.png rename to public/images/google.png diff --git a/routes/share.js b/routes/share.js index c8317e1..aad2671 100644 --- a/routes/share.js +++ b/routes/share.js @@ -36,7 +36,7 @@ module.exports = function(req, res, next) { Q.timeout(services[serviceId].lookupId(itemId, type), 5000).then(function(item) { for (var id in services) { if (id != serviceId) { - promises.push(Q.timeout(services[id].search(item), 5000)); + promises.push(Q.timeout(services[id].search(item), 10000)); } }