/
/
# What does this implement/fix? Users reported AI Radio weather segments announcing weather that had nothing to do with their configured location. Three separate bugs caused this: - The Open-Meteo geocoding request filtered on a `country` parameter, which the API silently ignores (the real parameter is `countryCode`). When no candidate in the top 10 results matched the configured country, the code silently fell back to the first result: a same-named city in another country (e.g. Cambridge NZ got Cambridge, England). - Open-Meteo reports `current.time` on a 15-minute grid while the hourly series uses whole hours, so the exact-match lookup for the "next hours" window failed 45 minutes of every hour and the summary fell back to 00:00-05:00 of the current day: night-time temperatures and rain chances at any time of day, for everyone. - When the weather lookup failed at render time, the weather placeholders were substituted with empty strings and the LLM (web search disabled) fabricated a forecast out of nothing. Changes: - Send `countryCode` to the geocoding API and raise instead of silently picking a foreign city when no result matches the configured country - Match the hourly window on the truncated hour when the exact `current.time` lookup fails - New `weather_required` flag per planned clip: a weather-only clip with no weather data at render time is skipped; a merged clip (e.g. weather + news) still airs, with the LLM explicitly instructed to leave weather out and not invent a forecast **Related issue (if applicable):** - related issue N/A (user reports via Discord) ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives the label from the ticked box and applies it automatically; the release-notes generator uses that same label to slot this change into the next release notes. --> - [x] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] 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.