mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-19 09:06:14 +00:00
TuneIn's Tune.ashx returns several stream URLs per station (different bitrates/CDNs) so a speaker can fail over when one is dead. TuneInPlayback parsed the full list but forwarded only urls[0], wrapping a single URL in the audio.streams[] array. When TuneIn listed a dead variant first (e.g. station s56857 / NDR 2 Niedersachsen, whose aac/low 404s while mp3/128 plays), the speaker had no fallback and dead-ended retrying the 404. Add BuildCustomStreamResponseFromURLs to emit one Stream per candidate in provider order (top-level StreamUrl mirrors urls[0] for compatibility), have the single-URL BuildCustomStreamResponse delegate to it, and forward the full slice from TuneInPlayback. The other single-URL callers (PlayCustomStream, the custom-stream handler) are unchanged. Confirmed on real hardware: the speaker now fails over from the 404'd aac/low to the working mp3/128 stream and plays. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>