Ability to set (per-client) to clear tracklist before playing, fixes #134

This commit is contained in:
James Barnsley
2017-06-28 08:36:09 +12:00
parent f008f189b3
commit ad6cc87e27
2 changed files with 26 additions and 2 deletions

View File

@ -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]