More debug options; Queue metadata changed handler
This commit is contained in:
@ -14,6 +14,10 @@ const MopidyMiddleware = (function(){
|
||||
|
||||
// handle all manner of socket messages
|
||||
const handleMessage = (ws, store, type, data) => {
|
||||
|
||||
// if debug enabled
|
||||
if (store.getState().ui.log_mopidy) console.log('Mopidy', type, data)
|
||||
|
||||
switch( type ){
|
||||
|
||||
case 'state:online':
|
||||
|
||||
@ -23,6 +23,9 @@ const PusherMiddleware = (function(){
|
||||
// handle all manner of socket messages
|
||||
const handleMessage = (ws, store, message) => {
|
||||
|
||||
// if debug enabled
|
||||
if (store.getState().ui.log_pusher) console.log('Pusher', message)
|
||||
|
||||
// response to a request [we] made
|
||||
if (typeof(message.request_id) !== 'undefined' && message.request_id){
|
||||
if (typeof( deferredRequests[ message.request_id ]) !== 'undefined' ){
|
||||
@ -168,7 +171,7 @@ const PusherMiddleware = (function(){
|
||||
request('get_queue_metadata')
|
||||
.then(
|
||||
response => {
|
||||
response.type = 'QUEUE_METADATA'
|
||||
response.type = 'PUSHER_QUEUE_METADATA'
|
||||
store.dispatch(response)
|
||||
}
|
||||
)
|
||||
|
||||
@ -131,8 +131,8 @@ export default function reducer(ui = {}, action){
|
||||
current_track: current_track
|
||||
});
|
||||
|
||||
case 'QUEUE_METADATA':
|
||||
case 'QUEUE_METADATA_CHANGED':
|
||||
case 'PUSHER_QUEUE_METADATA':
|
||||
case 'PUSHER_QUEUE_METADATA_CHANGED':
|
||||
var tracklist = Object.assign([], ui.current_tracklist)
|
||||
for( var i = 0; i < tracklist.length; i++ ){
|
||||
|
||||
|
||||
@ -78,7 +78,23 @@ class Debug extends React.Component{
|
||||
name="emulate_touch"
|
||||
checked={ this.props.log_actions }
|
||||
onChange={ e => this.props.uiActions.set({ log_actions: !this.props.log_actions })} />
|
||||
<span className="label">Log actions in developer console</span>
|
||||
<span className="label">Log actions</span>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="emulate_touch"
|
||||
checked={ this.props.log_mopidy }
|
||||
onChange={ e => this.props.uiActions.set({ log_mopidy: !this.props.log_mopidy })} />
|
||||
<span className="label">Log Mopidy</span>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
name="emulate_touch"
|
||||
checked={ this.props.log_pusher }
|
||||
onChange={ e => this.props.uiActions.set({ log_pusher: !this.props.log_pusher })} />
|
||||
<span className="label">Log Pusher</span>
|
||||
</label>
|
||||
<label>
|
||||
<input
|
||||
|
||||
Reference in New Issue
Block a user