mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 09:06:14 +00:00
A speaker can drop its own active source mid-playback (errorUpdate 1041 SOURCE_DISCONNECTED -> now_playing INVALID_SOURCE) while the SoundTouch WebSocket control channel stays healthy throughout. Nothing previously noticed this: logNowPlayingError only logged the transition, leaving the speaker silent until someone manually re-selected the source. Add autoResumeState, tracking the last healthy ContentItem per device connection. On a fresh transition into an error source (not a repeat of one already seen), it re-issues that ContentItem via SelectContentItem after a short backoff - the same call pressing the preset again makes. No attempt cap: if the resume itself fails, the source stays in error and nothing fires again until a genuine recovery is observed, which already bounds retries for a station that's truly gone without capping a station that legitimately (and repeatedly) recovers on its own.