diff --git a/lib/services/beats.js b/lib/services/beats.js index 93bf9e0..54ad427 100644 --- a/lib/services/beats.js +++ b/lib/services/beats.js @@ -96,7 +96,7 @@ module.exports.search = function(data) { if (type == "album") { cleanedData.name = matches[0].trim(); } else if (type == "track") { - cleanedData.album = matches[0].trim(); + cleanedData.album.name = matches[0].trim(); } module.exports.search(cleanedData).then(deferred.resolve); } else { diff --git a/lib/services/deezer.js b/lib/services/deezer.js index d1db89a..ef08760 100644 --- a/lib/services/deezer.js +++ b/lib/services/deezer.js @@ -84,7 +84,7 @@ module.exports.search = function(data, next) { if (type == "album") { cleanedData.name = matches[0].trim(); } else if (type == "track") { - cleanedData.album = matches[0].trim(); + cleanedData.album.name = matches[0].trim(); } module.exports.search(cleanedData).then(deferred.resolve); } else { diff --git a/lib/services/googleplaymusic.js b/lib/services/googleplaymusic.js index 11194a0..b3e1cab 100644 --- a/lib/services/googleplaymusic.js +++ b/lib/services/googleplaymusic.js @@ -89,7 +89,7 @@ module.exports.search = function(data) { if (type == "album") { cleanedData.name = matches[0].trim(); } else if (type == "track") { - cleanedData.album = matches[0].trim(); + cleanedData.album.name = matches[0].trim(); } module.exports.search(cleanedData).then(deferred.resolve); } else { diff --git a/lib/services/itunes.js b/lib/services/itunes.js index b1cda6d..0d3c36b 100644 --- a/lib/services/itunes.js +++ b/lib/services/itunes.js @@ -77,7 +77,7 @@ module.exports.search = function(data) { if (type == "album") { cleanedData.name = matches[0].trim(); } else if (type == "track") { - cleanedData.album = matches[0].trim(); + cleanedData.album.name = matches[0].trim(); } module.exports.search(cleanedData).then(deferred.resolve); } else { diff --git a/lib/services/rdio.js b/lib/services/rdio.js index bc87493..693dc98 100644 --- a/lib/services/rdio.js +++ b/lib/services/rdio.js @@ -115,19 +115,19 @@ module.exports.search = function(data) { var result = results.filter(function(result) { if (type == "album" && result.name.match(/([^\(\[]+)/)[0] == albumClean) { return result; - } else if (type == "track" && result.album.match(/([^\(\[]+)/)[0] == albumClean) { + } else if (type == "track" && result.album.name.match(/([^\(\[]+)/)[0] == albumClean) { return result; } }).shift(); if (!result) { var matches = albumClean.match(/^[^\(\[]+/); - if (matches[0] && matches[0] != album) { + if (matches[0] && matches[0] != albumClean) { var cleanedData = JSON.parse(JSON.stringify(data)); if (type == "album") { cleanedData.name = matches[0].trim(); } else if (type == "track") { - cleanedData.album = matches[0].trim(); + cleanedData.album.name = matches[0].trim(); } module.exports.search(cleanedData).then(deferred.resolve); } else { diff --git a/lib/services/spotify.js b/lib/services/spotify.js index 4ff7123..c995e37 100644 --- a/lib/services/spotify.js +++ b/lib/services/spotify.js @@ -82,7 +82,7 @@ module.exports.search = function(data) { if (type == "album") { cleanedData.name = matches[0].trim(); } else if (type == "track") { - cleanedData.album = matches[0].trim(); + cleanedData.album.name = matches[0].trim(); } module.exports.search(cleanedData).then(deferred.resolve); } else {