Add tests for Beats

This commit is contained in:
Jonathan Cremin 2014-12-04 16:29:39 +00:00
parent 1a7896716f
commit 7cc68d1968
4 changed files with 62 additions and 1 deletions

View file

@ -62,6 +62,10 @@ module.exports.search = function(data, next) {
return a.score < b.score;
}).shift();
if (!result.album && !result.track) {
next({service:"googleplaymusic"});
}
var id;
if (type == "album") {
id = result.album.albumId;

View file

@ -58,6 +58,10 @@ module.exports.search = function(data, next) {
return;
}
if (!data[type + "s"].items[0]) {
next({service:"spotify"});
}
var item = data[type + "s"].items[0];
module.exports.lookupId(item.id, type, next);