Removing clients from a group
This commit is contained in:
@ -93,7 +93,6 @@ const MopidyMiddleware = (function(){
|
||||
break;
|
||||
|
||||
case 'event:trackPlaybackEnded':
|
||||
// This doesn't fire when it's the last track in the queue... bug in Mopidy?
|
||||
store.dispatch(mopidyActions.clearCurrentTrack());
|
||||
store.dispatch(mopidyActions.getTimePosition());
|
||||
break;
|
||||
|
||||
@ -243,7 +243,6 @@ export function setSnapcastClientLatency(id, latency){
|
||||
}
|
||||
|
||||
export function setSnapcastClientGroup(id, group_id){
|
||||
console.log(id,group_id);
|
||||
return {
|
||||
type: 'PUSHER_SET_SNAPCAST_CLIENT_GROUP',
|
||||
id: id,
|
||||
|
||||
@ -599,7 +599,6 @@ const PusherMiddleware = (function(){
|
||||
break
|
||||
|
||||
case 'PUSHER_SNAPCAST_SERVER_LOADED':
|
||||
console.log(action);
|
||||
var groups = {};
|
||||
var clients = {};
|
||||
var streams = {};
|
||||
@ -778,8 +777,22 @@ const PusherMiddleware = (function(){
|
||||
break
|
||||
|
||||
case 'PUSHER_SET_SNAPCAST_CLIENT_GROUP':
|
||||
|
||||
var group = store.getState().pusher.snapcast_groups[action.group_id];
|
||||
var clients_ids = Object.assign([], group.clients_ids, [action.id]);
|
||||
var clients_ids = group.clients_ids;
|
||||
var clients_ids_index = clients_ids.indexOf(action.id);
|
||||
|
||||
// Not in group (yet), so add it
|
||||
if (clients_ids_index <= -1){
|
||||
clients_ids.push(action.id);
|
||||
|
||||
// Already there, so remove it
|
||||
} else {
|
||||
clients_ids.splice(clients_ids_index, 1);
|
||||
}
|
||||
|
||||
console.log(clients_ids, action.id, clients_ids_index);
|
||||
|
||||
var data = {
|
||||
method: 'Group.SetClients',
|
||||
params: {
|
||||
|
||||
Reference in New Issue
Block a user