jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

Update preset-announcement.js to skip restore of idle players #891

Open crissmil opened 1 month ago

crissmil commented 1 month ago

When using presets all players get backup/restore. This affects a playing player by restoring it to the time of backup state.elapsedTime, even if this player is not included in the preset file and is supposed to be skipped. Even if pauseOthers is set to false, by this behavior the player still get interrupted one sec because it is shifted back to recorded elapsedTime.

This PR is changing "saveAll" to "savePresetPlayers" and will backup/restore only players specified in preset file. Idle players are no more affected by running presets.

Tested and found more stable when joining/leaving groups after tts or chime clips.