Fix itunes
This commit is contained in:
parent
ee69decc46
commit
49cf87d5c9
1 changed files with 3 additions and 3 deletions
|
@ -68,9 +68,9 @@ module.exports.search = function(data) {
|
|||
|
||||
var path = "/search?term=" + encodeURIComponent(query) + "&media=music&entity=" + entity;
|
||||
request.get(apiRoot + path, function(res) {
|
||||
var data = JSON.parse(res.text);
|
||||
var result = JSON.parse(res.text);
|
||||
|
||||
if (!data.results[0]) {
|
||||
if (!result.results[0]) {
|
||||
var matches = album.match(/^[^\(\[]+/);
|
||||
if (matches[0]) {
|
||||
var cleanedData = JSON.parse(JSON.stringify(data));
|
||||
|
@ -84,7 +84,7 @@ module.exports.search = function(data) {
|
|||
deferred.resolve({service: "itunes"});
|
||||
}
|
||||
} else {
|
||||
var result = data.results[0];
|
||||
var result = result.results[0];
|
||||
|
||||
var item = {
|
||||
service: "itunes",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue