Ability to set (per-client) to clear tracklist before playing, fixes #134
This commit is contained in:
@ -254,6 +254,11 @@ const MopidyMiddleware = (function(){
|
||||
|
||||
case 'MOPIDY_PLAY_PLAYLIST':
|
||||
|
||||
// Clear tracklist (if set)
|
||||
if (store.getState().ui.clear_tracklist_on_play){
|
||||
store.dispatch(mopidyActions.clearTracklist())
|
||||
}
|
||||
|
||||
// playlist already in index
|
||||
if (store.getState().ui.playlists.hasOwnProperty(action.uri)){
|
||||
|
||||
@ -403,9 +408,14 @@ const MopidyMiddleware = (function(){
|
||||
|
||||
case 'MOPIDY_PLAY_URIS':
|
||||
|
||||
// stop the radio
|
||||
// Stop the radio
|
||||
if (store.getState().ui.radio && store.getState().ui.radio.enabled){
|
||||
store.dispatch( pusherActions.stopRadio() )
|
||||
store.dispatch(pusherActions.stopRadio())
|
||||
}
|
||||
|
||||
// Clear tracklist (if set)
|
||||
if (store.getState().ui.clear_tracklist_on_play){
|
||||
store.dispatch(mopidyActions.clearTracklist())
|
||||
}
|
||||
|
||||
var first_uri = action.uris[0]
|
||||
|
||||
@ -278,6 +278,20 @@ class Settings extends React.Component{
|
||||
|
||||
<h4 className="underline">Advanced</h4>
|
||||
|
||||
<div className="field checkbox">
|
||||
<div className="name">Customise behavior</div>
|
||||
<div className="input">
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="log_actions"
|
||||
checked={ this.props.ui.clear_tracklist_on_play }
|
||||
onChange={ e => this.props.uiActions.set({ clear_tracklist_on_play: !this.props.ui.clear_tracklist_on_play })} />
|
||||
<span className="label">Clear tracklist on play of URI(s)</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="field pusher-connections">
|
||||
<div className="name">Connections</div>
|
||||
<div className="input">
|
||||
|
||||
Reference in New Issue
Block a user