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;
|
var path = "/search?term=" + encodeURIComponent(query) + "&media=music&entity=" + entity;
|
||||||
request.get(apiRoot + path, function(res) {
|
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(/^[^\(\[]+/);
|
var matches = album.match(/^[^\(\[]+/);
|
||||||
if (matches[0]) {
|
if (matches[0]) {
|
||||||
var cleanedData = JSON.parse(JSON.stringify(data));
|
var cleanedData = JSON.parse(JSON.stringify(data));
|
||||||
|
@ -84,7 +84,7 @@ module.exports.search = function(data) {
|
||||||
deferred.resolve({service: "itunes"});
|
deferred.resolve({service: "itunes"});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var result = data.results[0];
|
var result = result.results[0];
|
||||||
|
|
||||||
var item = {
|
var item = {
|
||||||
service: "itunes",
|
service: "itunes",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue