/
/
# What does this implement/fix? Follow-up to #5773 (per-provider concurrent stream limits). When a track's provider has no free stream slot, playback retries other mappings of the track — but a track that only exists on that one provider had nowhere to go: playback waited out the full capacity budget and stopped, even when the same track is available on another configured streaming service. Now, when every known source for a track is at its stream limit, Music Assistant searches the user's other streaming providers for the same track (using the existing strict matching) and plays it from there. - When all known sources are saturated, other configured streaming providers are searched for a matching track and the match joins the normal source selection. - The search is strict (never plays a wrong track), bounded to a few seconds within the existing capacity budget, and only runs when playback would otherwise fail — zero cost in normal operation. - For library tracks the discovered mapping is saved, so future plays have it available right away. - Speculative next-track preparation skips the search and stays cheap; if nothing is found, behavior is unchanged (one final wait on the busy provider). **Related issue (if applicable):** - follow-up to #5773 ## Types of changes - [ ] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [x] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.