Skip to content

Require a filter term when filtering stations - #1571

Merged
frenck merged 1 commit into
mainfrom
frenck/stations-filter-term
Oct 1, 2026
Merged

frenck merged 1 commit into
mainfrom
frenck/stations-filter-term

Conversation

@frenck

@frenck frenck commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Breaking change

stations() with a filter_by but no filter_term now raises a ValueError before sending a request. It used to send a request for a path the API does not have, which failed with a 404 (raised as a RadioBrowserError). Pass a filter_term, or leave out filter_by to list all stations.

Proposed change

Found in a review of the library. stations(filter_by=FilterBy.CODEC) requested /json/stations/bycodec. Every by* path in the API documentation takes a search term, and the live API answers a path without one with a 404:

GET /json/stations/bycodec?limit=3  -> 404

stations() now refuses filter_by without a filter_term, like search() already does. The existing test that described the old behavior (requesting the path without a term) now checks that the call is refused and that no request is sent.

Type of change

  • Dependency or tooling upgrade
  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Deprecation (replaces or removes a feature, with a migration path)
  • Breaking change (a fix or feature that changes existing behavior)
  • Code quality, refactor, or test-only change
  • Documentation only

Additional information

  • This PR fixes or closes issue: fixes # None
  • This PR is related to: None
  • Link to a separate documentation pull request: None

Checklist

  • I fully understand the code in this pull request and can explain every line, including any AI-assisted changes.
  • The change is covered by tests, and poetry run pytest passes locally. A pull request cannot be merged unless CI is green.
  • poetry run prek run --all-files passes (lint, format, and type checks).
  • No commented-out or dead code is left in the pull request.

Every by* path of the API takes a search term; without one it answers
with a 404. Refuse filter_by without a filter_term before sending the
request, like search() already does.
@frenck frenck added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Oct 1, 2026
@frenck
frenck merged commit aa83366 into main Oct 1, 2026
31 checks passed
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.

1 participant