Skip to content

Fix search parameter names and filter_by in search - #1550

Closed
balloobbot wants to merge 1 commit into
frenck:mainfrom
balloobbot:fix-search-params
Closed

balloobbot wants to merge 1 commit into
frenck:mainfrom
balloobbot:fix-search-params

Conversation

@balloobbot

Copy link
Copy Markdown

Proposed Changes

Station search ignored the exact-match and bitrate filters. It sent their names in snake_case, but the API expects camelCase. Search with a filter-by field always failed, because the API has no such paths under the search endpoint. Search now sends the correct names and turns filter-by into query parameters.

The API ignores the snake_case names without an error:

GET /json/stations/search?name=538&name_exact=true  -> 5 stations (538, 538 90s AAC, 538 Classics, ...)
GET /json/stations/search?name=538&nameExact=true   -> 1 station (538)

Every filter-by path under the search endpoint returns 404:

GET /json/stations/search/bycountrycodeexact/NL  -> 404
GET /json/stations/search/byname/538             -> 404
GET /json/stations/bycountrycodeexact/NL         -> 200

Related Issues

None.

🤖 Generated with Claude Code

search() sent the multi-word parameters in snake_case, for example
name_exact and bitrate_min. The API expects camelCase names, such as
nameExact and bitrateMin. It ignored the snake_case names, so these
filters had no effect. search() now sends the camelCase names. The
Python argument names do not change.

search() appended filter_by and filter_term to the stations/search
path. The API has no by* paths under stations/search and returns 404
for each of them. search() now sends filter_by as the matching search
query parameters. filter_by overrides the explicit value and exact
flag for the same field. The search endpoint has no parameter for
FilterBy.UUID and no partial codec match for FilterBy.CODEC, so
search() raises ValueError for these values. It also raises
ValueError when filter_by is set without filter_term.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Sep 28, 2026
@frenck

frenck commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Thanks! Verified the camelCase names and the 404 on the by* search paths against the live API, both spot on. This still crashed on search() without a name (None in the query) and conflicted with #1549 and the tooling update on main, so I combined both into #1552.

../Frenck

                       

Blogging my personal ramblings at frenck.dev

@frenck frenck closed this Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants