Adding multi-server support
This commit is contained in:
@ -1 +1 @@
|
|||||||
3.47.0
|
3.48.0
|
||||||
@ -3,7 +3,7 @@ import pathlib
|
|||||||
|
|
||||||
from mopidy import config, ext
|
from mopidy import config, ext
|
||||||
|
|
||||||
__version__ = "3.47.0"
|
__version__ = "3.48.0"
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@ -70879,6 +70879,7 @@ var Servers = function Servers(_ref) {
|
|||||||
_store$getState$mopid = _store$getState.mopidy,
|
_store$getState$mopid = _store$getState.mopidy,
|
||||||
servers = _store$getState$mopid.servers,
|
servers = _store$getState$mopid.servers,
|
||||||
current_server = _store$getState$mopid.current_server,
|
current_server = _store$getState$mopid.current_server,
|
||||||
|
ssl = _store$getState$mopid.ssl,
|
||||||
mopidyConnected = _store$getState$mopid.connected,
|
mopidyConnected = _store$getState$mopid.connected,
|
||||||
mopidyConnecting = _store$getState$mopid.connecting,
|
mopidyConnecting = _store$getState$mopid.connecting,
|
||||||
_store$getState$pushe = _store$getState.pusher,
|
_store$getState$pushe = _store$getState.pusher,
|
||||||
@ -71050,23 +71051,59 @@ var Servers = function Servers(_ref) {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
_react2.default.createElement(
|
_react2.default.createElement(
|
||||||
'label',
|
'div',
|
||||||
{ className: 'field' },
|
{ className: 'field checkbox' },
|
||||||
_react2.default.createElement('div', { className: 'name' }),
|
_react2.default.createElement(
|
||||||
|
'div',
|
||||||
|
{ className: 'name' },
|
||||||
|
'Encryption'
|
||||||
|
),
|
||||||
_react2.default.createElement(
|
_react2.default.createElement(
|
||||||
'div',
|
'div',
|
||||||
{ className: 'input' },
|
{ className: 'input' },
|
||||||
_react2.default.createElement(
|
_react2.default.createElement(
|
||||||
'button',
|
'label',
|
||||||
{ className: 'button button--primary', disabled: server.id === current_server, onClick: setAsCurrent },
|
null,
|
||||||
'Switch to this server'
|
_react2.default.createElement('input', {
|
||||||
),
|
type: 'checkbox',
|
||||||
_react2.default.createElement(
|
name: 'ssl',
|
||||||
'button',
|
value: server.ssl,
|
||||||
{ className: 'button button--destructive', onClick: remove },
|
checked: server.ssl,
|
||||||
'Remove'
|
onChange: function onChange() {
|
||||||
|
return dispatch(mopidyActions.updateServer({ id: server.id, ssl: !server.ssl }));
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
_react2.default.createElement(
|
||||||
|
'span',
|
||||||
|
{ className: 'label tooltip' },
|
||||||
|
'Use SSL',
|
||||||
|
_react2.default.createElement(
|
||||||
|
'span',
|
||||||
|
{ className: 'tooltip__content' },
|
||||||
|
'Requires a SSL proxy'
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
_react2.default.createElement(
|
||||||
|
'button',
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
className: 'button button--primary',
|
||||||
|
onClick: setAsCurrent
|
||||||
|
},
|
||||||
|
'Switch to this server'
|
||||||
|
),
|
||||||
|
_react2.default.createElement(
|
||||||
|
'button',
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
className: 'button button--destructive',
|
||||||
|
disabled: server.id === current_server,
|
||||||
|
onClick: remove
|
||||||
|
},
|
||||||
|
'Remove'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -77050,7 +77087,6 @@ function getAlbum(uri, artist, album) {
|
|||||||
sendRequest(dispatch, getState, params).then(function (response) {
|
sendRequest(dispatch, getState, params).then(function (response) {
|
||||||
if (response.album) {
|
if (response.album) {
|
||||||
var existing_album = getState().core.albums[uri];
|
var existing_album = getState().core.albums[uri];
|
||||||
|
|
||||||
var _album = {
|
var _album = {
|
||||||
uri: uri,
|
uri: uri,
|
||||||
images: response.album.image,
|
images: response.album.image,
|
||||||
@ -77120,8 +77156,7 @@ function getImages(context, uri) {
|
|||||||
if (params) {
|
if (params) {
|
||||||
sendRequest(dispatch, getState, params).then(function (response) {
|
sendRequest(dispatch, getState, params).then(function (response) {
|
||||||
if (response.album) {
|
if (response.album) {
|
||||||
record = _extends({}, record, { images: response.album.image });
|
dispatch(coreActions.albumLoaded({ uri: uri, images: response.album.image }));
|
||||||
dispatch(coreActions.albumLoaded(record));
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -77744,7 +77779,8 @@ function addServer() {
|
|||||||
id: (0, _helpers.generateGuid)(),
|
id: (0, _helpers.generateGuid)(),
|
||||||
name: 'New server',
|
name: 'New server',
|
||||||
host: window.location.hostname,
|
host: window.location.hostname,
|
||||||
port: window.location.port ? window.location.port : window.location.protocol === 'https:' ? '443' : '80'
|
port: window.location.port ? window.location.port : window.location.protocol === 'https:' ? '443' : '80',
|
||||||
|
ssl: window.location.protocol === 'https:'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -78555,7 +78591,7 @@ var MopidyMiddleware = function () {
|
|||||||
var state = store.getState();
|
var state = store.getState();
|
||||||
|
|
||||||
socket = new _mopidy2.default({
|
socket = new _mopidy2.default({
|
||||||
webSocketUrl: 'ws' + (window.location.protocol === 'https:' ? 's' : '') + '://' + state.mopidy.host + ':' + state.mopidy.port + '/mopidy/ws/',
|
webSocketUrl: 'ws' + (state.mopidy.ssl ? 's' : '') + '://' + state.mopidy.host + ':' + state.mopidy.port + '/mopidy/ws/',
|
||||||
callingConvention: 'by-position-or-by-name'
|
callingConvention: 'by-position-or-by-name'
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -78601,7 +78637,10 @@ var MopidyMiddleware = function () {
|
|||||||
store.dispatch(mopidyActions.set({
|
store.dispatch(mopidyActions.set({
|
||||||
current_server: action.server.id,
|
current_server: action.server.id,
|
||||||
host: action.server.host,
|
host: action.server.host,
|
||||||
port: action.server.port
|
port: action.server.port,
|
||||||
|
ssl: action.server.ssl,
|
||||||
|
connected: false,
|
||||||
|
connecting: false
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Wait a moment for store to update, then attempt connection
|
// Wait a moment for store to update, then attempt connection
|
||||||
@ -80451,11 +80490,13 @@ var MopidyMiddleware = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var action_data = {
|
if (records.length) {
|
||||||
type: (action.context + '_LOADED').toUpperCase()
|
var action_data = {
|
||||||
};
|
type: (action.context + '_LOADED').toUpperCase()
|
||||||
action_data[action.context] = records;
|
};
|
||||||
store.dispatch(action_data);
|
action_data[action.context] = records;
|
||||||
|
store.dispatch(action_data);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97168,6 +97209,16 @@ var LibraryBrowse = function (_React$Component) {
|
|||||||
subdirectory.icons = ['/iris/assets/backgrounds/browse-somafm.jpg'];
|
subdirectory.icons = ['/iris/assets/backgrounds/browse-somafm.jpg'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'Tidal':
|
||||||
|
subdirectory.icons = ['/iris/assets/backgrounds/browse-tidal.jpg'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Google':
|
||||||
|
case 'Google Play':
|
||||||
|
case 'Google Play Music':
|
||||||
|
subdirectory.icons = ['/iris/assets/backgrounds/browse-google.jpg'];
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
subdirectory.icons = ['/iris/assets/backgrounds/browse-default.jpg'];
|
subdirectory.icons = ['/iris/assets/backgrounds/browse-default.jpg'];
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
6
mopidy_iris/static/app.min.js
vendored
6
mopidy_iris/static/app.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
mopidy_iris/static/assets/backgrounds/browse-tidal.jpg
Normal file
BIN
mopidy_iris/static/assets/backgrounds/browse-tidal.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
@ -100,8 +100,8 @@
|
|||||||
|
|
||||||
// Release details
|
// Release details
|
||||||
// These are automatically injected to built HTML
|
// These are automatically injected to built HTML
|
||||||
var build = "1588065802";
|
var build = "1588218286";
|
||||||
var version = "3.47.0";
|
var version = "3.48.0";
|
||||||
|
|
||||||
// Construct the script tag
|
// Construct the script tag
|
||||||
var js = document.createElement("script");
|
var js = document.createElement("script");
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mopidy-iris",
|
"name": "mopidy-iris",
|
||||||
"version": "3.47.0",
|
"version": "3.48.0",
|
||||||
"description": "Mopidy HTTP interface",
|
"description": "Mopidy HTTP interface",
|
||||||
"repository": "https://github.com/jaedb/iris",
|
"repository": "https://github.com/jaedb/iris",
|
||||||
"author": "James Barnsley <james@barnsley.nz>",
|
"author": "James Barnsley <james@barnsley.nz>",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = Mopidy-Iris
|
name = Mopidy-Iris
|
||||||
version = 3.47.0
|
version = 3.48.0
|
||||||
url = https://github.com/jaedb/iris
|
url = https://github.com/jaedb/iris
|
||||||
author = James Barnsley
|
author = James Barnsley
|
||||||
author_email = james@barnsley.nz
|
author_email = james@barnsley.nz
|
||||||
|
|||||||
BIN
src/assets/backgrounds/browse-tidal.jpg
Executable file
BIN
src/assets/backgrounds/browse-tidal.jpg
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
@ -24,6 +24,7 @@ const Servers = ({
|
|||||||
mopidy: {
|
mopidy: {
|
||||||
servers,
|
servers,
|
||||||
current_server,
|
current_server,
|
||||||
|
ssl,
|
||||||
connected: mopidyConnected,
|
connected: mopidyConnected,
|
||||||
connecting: mopidyConnecting,
|
connecting: mopidyConnecting,
|
||||||
},
|
},
|
||||||
@ -132,14 +133,41 @@ const Servers = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
<label className="field">
|
|
||||||
<div className="name" />
|
|
||||||
<div className="input">
|
|
||||||
<button className="button button--primary" disabled={server.id === current_server} onClick={setAsCurrent}>Switch to this server</button>
|
|
||||||
<button className="button button--destructive" onClick={remove}>Remove</button>
|
|
||||||
</div>
|
|
||||||
</label>
|
|
||||||
|
|
||||||
|
<div className="field checkbox">
|
||||||
|
<div className="name">Encryption</div>
|
||||||
|
<div className="input">
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
name="ssl"
|
||||||
|
value={server.ssl}
|
||||||
|
checked={server.ssl}
|
||||||
|
onChange={() => dispatch(mopidyActions.updateServer({ id: server.id, ssl: !server.ssl }))}
|
||||||
|
/>
|
||||||
|
<span className="label tooltip">
|
||||||
|
Use SSL
|
||||||
|
<span className="tooltip__content">Requires a SSL proxy</span>
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="button button--primary"
|
||||||
|
onClick={setAsCurrent}
|
||||||
|
>
|
||||||
|
Switch to this server
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="button button--destructive"
|
||||||
|
disabled={server.id === current_server}
|
||||||
|
onClick={remove}
|
||||||
|
>
|
||||||
|
Remove
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -264,8 +264,7 @@ export function getAlbum(uri, artist, album, mbid = false) {
|
|||||||
(response) => {
|
(response) => {
|
||||||
if (response.album) {
|
if (response.album) {
|
||||||
const existing_album = getState().core.albums[uri];
|
const existing_album = getState().core.albums[uri];
|
||||||
|
const album = {
|
||||||
const album = {
|
|
||||||
uri,
|
uri,
|
||||||
images: response.album.image,
|
images: response.album.image,
|
||||||
listeners: parseInt(response.album.listeners),
|
listeners: parseInt(response.album.listeners),
|
||||||
@ -342,8 +341,7 @@ export function getImages(context, uri) {
|
|||||||
.then(
|
.then(
|
||||||
(response) => {
|
(response) => {
|
||||||
if (response.album) {
|
if (response.album) {
|
||||||
record = { ...record, images: response.album.image };
|
dispatch(coreActions.albumLoaded({ uri, images: response.album.image }));
|
||||||
dispatch(coreActions.albumLoaded(record));
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@ -31,7 +31,8 @@ export function addServer() {
|
|||||||
name: 'New server',
|
name: 'New server',
|
||||||
host: window.location.hostname,
|
host: window.location.hostname,
|
||||||
port: (window.location.port ? window.location.port : (window.location.protocol === 'https:' ? '443' : '80')),
|
port: (window.location.port ? window.location.port : (window.location.protocol === 'https:' ? '443' : '80')),
|
||||||
}
|
ssl: window.location.protocol === 'https:',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -249,7 +249,7 @@ const MopidyMiddleware = (function () {
|
|||||||
var state = store.getState();
|
var state = store.getState();
|
||||||
|
|
||||||
socket = new Mopidy({
|
socket = new Mopidy({
|
||||||
webSocketUrl: `ws${window.location.protocol === 'https:' ? 's' : ''}://${state.mopidy.host}:${state.mopidy.port}/mopidy/ws/`,
|
webSocketUrl: `ws${state.mopidy.ssl ? 's' : ''}://${state.mopidy.host}:${state.mopidy.port}/mopidy/ws/`,
|
||||||
callingConvention: 'by-position-or-by-name',
|
callingConvention: 'by-position-or-by-name',
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -294,7 +294,10 @@ const MopidyMiddleware = (function () {
|
|||||||
store.dispatch(mopidyActions.set({
|
store.dispatch(mopidyActions.set({
|
||||||
current_server: action.server.id,
|
current_server: action.server.id,
|
||||||
host: action.server.host,
|
host: action.server.host,
|
||||||
port: action.server.port
|
port: action.server.port,
|
||||||
|
ssl: action.server.ssl,
|
||||||
|
connected: false,
|
||||||
|
connecting: false,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// Wait a moment for store to update, then attempt connection
|
// Wait a moment for store to update, then attempt connection
|
||||||
@ -2371,11 +2374,13 @@ const MopidyMiddleware = (function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const action_data = {
|
if (records.length) {
|
||||||
type: (`${action.context}_LOADED`).toUpperCase(),
|
const action_data = {
|
||||||
};
|
type: (`${action.context}_LOADED`).toUpperCase(),
|
||||||
action_data[action.context] = records;
|
};
|
||||||
store.dispatch(action_data);
|
action_data[action.context] = records;
|
||||||
|
store.dispatch(action_data);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -59,7 +59,7 @@ let state = {
|
|||||||
connected: false,
|
connected: false,
|
||||||
host: window.location.hostname,
|
host: window.location.hostname,
|
||||||
port: (window.location.port ? window.location.port : (window.location.protocol === 'https:' ? '443' : '80')),
|
port: (window.location.port ? window.location.port : (window.location.protocol === 'https:' ? '443' : '80')),
|
||||||
ssl: (window.location.protocol === 'https:'),
|
ssl: window.location.protocol === 'https:',
|
||||||
current_server: 'default',
|
current_server: 'default',
|
||||||
servers: {
|
servers: {
|
||||||
default: {
|
default: {
|
||||||
@ -67,7 +67,7 @@ let state = {
|
|||||||
name: 'Default',
|
name: 'Default',
|
||||||
host: window.location.hostname,
|
host: window.location.hostname,
|
||||||
port: (window.location.port ? window.location.port : (window.location.protocol === 'https:' ? '443' : '80')),
|
port: (window.location.port ? window.location.port : (window.location.protocol === 'https:' ? '443' : '80')),
|
||||||
ssl: (window.location.protocol === 'https:')
|
ssl: window.location.protocol === 'https:',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mute: false,
|
mute: false,
|
||||||
|
|||||||
@ -71,6 +71,16 @@ class LibraryBrowse extends React.Component {
|
|||||||
subdirectory.icons = ['/iris/assets/backgrounds/browse-somafm.jpg'];
|
subdirectory.icons = ['/iris/assets/backgrounds/browse-somafm.jpg'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'Tidal':
|
||||||
|
subdirectory.icons = ['/iris/assets/backgrounds/browse-tidal.jpg'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Google':
|
||||||
|
case 'Google Play':
|
||||||
|
case 'Google Play Music':
|
||||||
|
subdirectory.icons = ['/iris/assets/backgrounds/browse-google.jpg'];
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
subdirectory.icons = ['/iris/assets/backgrounds/browse-default.jpg'];
|
subdirectory.icons = ['/iris/assets/backgrounds/browse-default.jpg'];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user