Dashticz / dashticz_v2

Alternative dashboard for Domoticz
107 stars 59 forks source link

Fixed the spotify.js scope #305

Closed Ectholian closed 6 years ago

Ectholian commented 6 years ago

Please test and review, I think this way the plugins are less sensitive for global scope bugs like the getDevices function.

robgeerts commented 6 years ago

will test right away!

robgeerts commented 6 years ago

Squashed one bug... It called getLoginURL where it needed to call _getLoginURL

Ectholian commented 6 years ago

Darnit, i think i messed a file up. I fixed that already :) The getracklist function has the same problem.

Ectholian commented 6 years ago

And the _getTracks too. Also, the last line of the module: }() has to be ended with a semicolon ;

robgeerts commented 6 years ago

ok, hold on

robgeerts commented 6 years ago

I think Im gonna try this plugin you mentioned: https://github.com/JMPerez/spotify-web-api-js

Ectholian commented 6 years ago

Might come in handy. Maybe my first quickfix is fine for the stable branch and for the beta this library might be good combined with this 'scoping' trick. I also see some javascript errors in the console when for example selecting a device without a playlist on it; this could potentially break the rest of javascript execution.

robgeerts commented 6 years ago

Ok, I will leave the original spotify.js in tact and work on another file while it is not finished ;)