Sort match results, fix xbox url parsing

This commit is contained in:
Jonathan Cremin 2015-01-07 00:05:43 +00:00
parent 89d0779751
commit 2d029f1a0f
2 changed files with 20 additions and 6 deletions

View file

@ -62,8 +62,11 @@ module.exports.parseUrl = function(url) {
var parsed = parse(url);
var parts = parsed.path.split("/");
var type = parts[1];
var id = parts[4];
var idMatches = parts[4].match(/[\w\-]+/);
var id = idMatches[0];
if (!id) {
return false;
}
return module.exports.lookupId("music." + id, type);
}