Parallax refinement; Album responsive; Pusher browser notifications

This commit is contained in:
James Barnsley
2016-11-29 15:36:01 +13:00
parent 6101ef264b
commit 83a899f24e
13 changed files with 216 additions and 48 deletions

View File

@ -161,6 +161,47 @@ const MopidyMiddleware = (function(){
instruct( socket, store, action.call, action.value )
break;
// send an instruction to the websocket
case 'MOPIDY_NEXT':
var icon = false
if( store.getState().ui.current_track ){
icon = helpers.getTrackIcon( store.getState().ui.current_track )
}
store.dispatch({
type: 'PUSHER_SEND_BROADCAST',
action: 'broadcast',
ignore_self: true,
data: {
type: 'notification',
data: {
title: 'Track skipped',
body: store.getState().pusher.username +' skipped this track',
icon: icon
}
}
})
break;
case 'MOPIDY_STOP':
var icon = false
if( store.getState().ui.current_track ){
icon = helpers.getTrackIcon( store.getState().ui.current_track )
}
store.dispatch({
type: 'PUSHER_SEND_BROADCAST',
action: 'broadcast',
ignore_self: true,
data: {
type: 'notification',
data: {
title: 'Playback stopped',
body: store.getState().pusher.username +' stopped playback',
icon: icon
}
}
})
break;
// send an instruction to the websocket
case 'MOPIDY_URISCHEMES':
var uri_schemes = action.data