From c7b9ea5b00b72c4b4173a568e7038a2e2ae63b39 Mon Sep 17 00:00:00 2001 From: Jonathan Cremin Date: Sat, 14 Feb 2015 01:50:59 +0000 Subject: [PATCH] Add support for rdio short urls --- lib/services/rdio/url.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/services/rdio/url.js b/lib/services/rdio/url.js index 173fecf..1dd96ac 100644 --- a/lib/services/rdio/url.js +++ b/lib/services/rdio/url.js @@ -6,6 +6,7 @@ module.exports.match = function(url) { if (!parsed.host.match(/rd\.io$/) && !parsed.host.match(/rdio\.com$/)) { return false; } - var matches = parsed.path.match(/[\/]*artist[\/]*([^\/]*)[\/]*album[\/]*([^\/]*)[\/]*([track]*)?[\/]*([^\/]*)/); - return !!matches[2]; + var regular = parsed.path.match(/[\/]*artist[\/]*([^\/]*)[\/]*album[\/]*([^\/]*)[\/]*([track]*)?[\/]*([^\/]*)/); + var short = parsed.path.match(/[\/]*x[\/]*([^\/]*)/); + return (regular && !!regular[2]) || (short && !!short[1]); };