Add album to matched tracks on rdio
This commit is contained in:
parent
c5ca1f4caf
commit
f4da977276
1 changed files with 24 additions and 6 deletions
|
@ -35,7 +35,7 @@ module.exports.lookupId = function(id) {
|
|||
var parsed = parse(result.shortUrl)
|
||||
var id = parsed.path.replace("/x/", "").replace("/", "");
|
||||
var type = result.album ? "track" : "album";
|
||||
deferred.resolve({
|
||||
var item = {
|
||||
service: "rdio",
|
||||
type: type,
|
||||
id: id,
|
||||
|
@ -46,7 +46,13 @@ module.exports.lookupId = function(id) {
|
|||
artist: {
|
||||
name: result.artist
|
||||
}
|
||||
});
|
||||
};
|
||||
if (type == "track") {
|
||||
item.album = {
|
||||
name: result.album
|
||||
};
|
||||
}
|
||||
deferred.resolve(item);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
@ -76,7 +82,7 @@ module.exports.parseUrl = function(url) {
|
|||
var parsed = parse(result.shortUrl)
|
||||
var id = parsed.path.replace("/x/", "").replace("/", "");
|
||||
var type = result.album ? "track" : "album";
|
||||
deferred.resolve({
|
||||
var item = {
|
||||
service: "rdio",
|
||||
type: type,
|
||||
id: id,
|
||||
|
@ -87,7 +93,13 @@ module.exports.parseUrl = function(url) {
|
|||
artist: {
|
||||
name: result.artist
|
||||
}
|
||||
});
|
||||
};
|
||||
if (type == "track") {
|
||||
item.album = {
|
||||
name: result.album
|
||||
};
|
||||
}
|
||||
deferred.resolve(item);
|
||||
});
|
||||
return deferred.promise;
|
||||
};
|
||||
|
@ -136,7 +148,7 @@ module.exports.search = function(data) {
|
|||
} else {
|
||||
var parsed = parse(result.shortUrl)
|
||||
var id = parsed.path.replace("/x/", "").replace("/", "");
|
||||
deferred.resolve({
|
||||
var item = {
|
||||
service: "rdio",
|
||||
type: type,
|
||||
id: id,
|
||||
|
@ -147,7 +159,13 @@ module.exports.search = function(data) {
|
|||
artist: {
|
||||
name: result.artist
|
||||
}
|
||||
});
|
||||
};
|
||||
if (type == "track") {
|
||||
item.album = {
|
||||
name: result.album
|
||||
};
|
||||
}
|
||||
deferred.resolve(item);
|
||||
}
|
||||
});
|
||||
return deferred.promise;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue