Handle non-album/track ids in GPM, 404 xbox

This commit is contained in:
Jonathan Cremin 2014-12-28 23:19:18 +00:00
parent b3ca20570e
commit 15712f9482
4 changed files with 14 additions and 3 deletions

View file

@ -72,6 +72,8 @@ module.exports.lookupId = function(id, type) {
var path = "/" + id + "/lookup";
return request.get(apiRoot + path).set("Authorization", "Bearer " + access_token).promise().then(function(res) {
return formatResponse(res);
}, function(res) {
return {service: "xbox"};
});
});
};
@ -92,6 +94,8 @@ module.exports.search = function(data) {
var path = "/music/search?q=" + encodeURIComponent(query) + "&filters=" + type + "s";
return request.get(apiRoot + path).set("Authorization", "Bearer " + access_token).promise().then(function(res) {
return formatResponse(res);
}, function(res) {
return {service: "xbox"};
});
});
};