Merge branch 'master' of https://github.com/maxerenberg/Iris into maxerenberg-master

This commit is contained in:
James Barnsley
2020-11-14 21:52:42 +13:00
16 changed files with 555874 additions and 42 deletions

View File

@ -25,15 +25,17 @@ class PlaybackControls extends React.Component {
this.state = {
expanded: false,
current_track: null,
stream_title: null,
transition_track: null,
transition_direction: null,
};
}
static getDerivedStateFromProps({ current_track }, state) {
static getDerivedStateFromProps({ current_track, stream_title }, state) {
return {
...state,
current_track,
stream_title,
};
}
@ -211,6 +213,7 @@ class PlaybackControls extends React.Component {
const {
current_track,
expanded,
stream_title,
transition_track,
transition_direction,
} = this.state;
@ -257,7 +260,12 @@ class PlaybackControls extends React.Component {
{current_track ? current_track.name : <span>-</span>}
</div>
<div className="artist">
{current_track ? <LinksSentence items={current_track.artists} /> : <LinksSentence />}
{
(current_track && current_track.artists
&& <LinksSentence items={current_track.artists} />)
|| (stream_title && <span className="links-sentence">{stream_title}</span>)
|| <LinksSentence />
}
</div>
</div>
</div>
@ -338,11 +346,13 @@ const mapStateToProps = (state) => {
items,
next_track_uri,
current_track,
stream_title,
} = state.core;
return {
snapcast_enabled: state.pusher.config.snapcast_enabled,
current_track: current_track ? items[current_track.uri] || current_track : null,
stream_title,
next_track: items[next_track_uri],
radio_enabled: (!!(state.ui.radio && state.ui.radio.enabled)),
play_state: state.mopidy.play_state,