From b12df536adcb2845196a6bbfa5c129fe303d5fa5 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Wed, 16 Sep 2015 12:09:59 -0700 Subject: [PATCH] [0.9 api]Fix built-in custom url --- data/js/tomahawk.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/js/tomahawk.js b/data/js/tomahawk.js index 756ff907b..2f23b30fd 100644 --- a/data/js/tomahawk.js +++ b/data/js/tomahawk.js @@ -268,7 +268,8 @@ Tomahawk.Resolver = Tomahawk.extend(TomahawkResolver, { var merged = []; return merged.concat.apply(merged,collectionResults); }).then(function(collectionResults) { - Promise.resolve(that.resolve({artist: artist, album: album, track:title})).then(function(results){ + if(typeof results === 'undefined') + results = []; Tomahawk.addTrackResults({ 'qid': qid, 'results': that._convertUrls(results.concat(collectionResults)) @@ -279,7 +280,7 @@ Tomahawk.Resolver = Tomahawk.extend(TomahawkResolver, { _adapter_init: function () { - this._urlProtocol = this.settings.name.replace(/\s+/g, '').toLowerCase(); + this._urlProtocol = this.settings.name.replace(/[^a-zA-Z]/g, '').toLowerCase(); Tomahawk.addCustomUrlHandler( this._urlProtocol, 'getStreamUrl', true ); Tomahawk.log('Registered custom url handler for protocol "' + this._urlProtocol + '"'); this.init();