Add deezer tests
This commit is contained in:
parent
066d3e2d24
commit
1b2c568ac6
2 changed files with 60 additions and 5 deletions
|
@ -78,12 +78,10 @@ module.exports.search = function(data, next) {
|
|||
|
||||
module.exports.parseUrl = function(url, next) {
|
||||
var deferred = Q.defer();
|
||||
var matches = parse(url).path.match(/\/albums[\/]+([^\/]+)(\/tracks\/)?([^\/]+)?/);
|
||||
var matches = parse(url).path.match(/\/(album|track)[\/]+([^\/]+)/);
|
||||
|
||||
if (matches && matches[3]) {
|
||||
module.exports.lookupId(matches[3]).then(deferred.resolve);
|
||||
} else if (matches && matches[1]) {
|
||||
module.exports.lookupId(matches[1]).then(deferred.resolve);
|
||||
if (matches && matches[2]) {
|
||||
module.exports.lookupId(matches[2], matches[1]).then(deferred.resolve);
|
||||
}
|
||||
return deferred.promise;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue