Repository navigation
Fix station search parameters and add search filters - #1552
Merged
Merged
Conversation
The search endpoint silently ignored the exact-match and bitrate filters, because they were sent in snake_case while the API expects camelCase. Searching with filter_by always failed, since the search endpoint has no by* paths. Calling search() without a name crashed on a None query value. - Send nameExact, countryExact, stateExact, languageExact, tagExact, bitrateMin and bitrateMax. - Translate filter_by into search query parameters; raise ValueError for values the search endpoint cannot express. - Add country_code, state, language and tag filters. - Leave unset filters out of the query. Based on #1549 and #1550.
This was referenced Sep 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change
None. The exact-match and bitrate filters never worked and
filter_byonsearch()always failed, so nothing that worked before behaves differently. Callers that already passed those filters will now get the filtered results they asked for.Proposed change
Station search was broken in three ways:
name_exact,bitrate_min), while the API expects camelCase. The API ignores unknown parameters without an error, so these filters silently did nothing.filter_bybuilt paths likestations/search/bycountrycodeexact/NL. The search endpoint has no such paths, so that always returned a 404.search()without anamecrashed, becauseNonewas passed as a query value and yarl rejects that.Checked against the live API:
This PR sends the parameter names the API expects, translates
filter_byinto search query parameters (raisingValueErrorforFilterBy.UUID,FilterBy.CODEC, or a missingfilter_term), addscountry_code,state,languageandtagfilters, and leaves unset filters out of the query. The Radio Browser media source in Home Assistant needs those filters to search inside a country, language or tag folder.This combines #1549 and #1550 into a single change on top of the tooling update from #1551, since both touched the same code and conflicted with
mainand with each other.Type of change
Additional information
Checklist
poetry run pytestpasses locally. A pull request cannot be merged unless CI is green.poetry run prek run --all-filespasses (lint, format, and type checks).