Syntax update to supported uri schemas, potentially affects #655

This commit is contained in:
James Barnsley
2020-11-22 21:11:36 +13:00
parent 8e26b0443e
commit bbf81003be

View File

@ -773,19 +773,12 @@ const MopidyMiddleware = (function () {
request(store, 'getUriSchemes')
.then(
(response) => {
const uri_schemes = response;
// Remove unsupported schemes
const remove = ['http', 'https', 'mms', 'rtmp', 'rtmps', 'rtsp', 'sc', 'yt'];
let uri_schemes = response.filter((uri) => remove.indexOf(uri) === -1);
// remove all our ignored types
for (var i = 0; i < remove.length; i++) {
const index = uri_schemes.indexOf(remove[i]);
if (index > -1) uri_schemes.splice(index, 1);
}
// append with ':' to make them a mopidy URI
for (var i = 0; i < uri_schemes.length; i++) {
uri_schemes[i] = `${uri_schemes[i]}:`;
}
// Append with ':' to make them a mopidy URI
uri_schemes = uri_schemes.map((uri) => `${uri}:`);
// Enable Iris providers when the backend is available
store.dispatch(spotifyActions.set({ enabled: uri_schemes.includes('spotify:') }));
@ -801,11 +794,6 @@ const MopidyMiddleware = (function () {
);
break;
/**
* Advanced playback events
* */
case 'MOPIDY_PLAY_PLAYLIST': {
const playlist = store.getState().core.items[action.uri];
if (playlist && playlist.tracks) {