Skip to content

Vote for a station - #1584

Merged
frenck merged 1 commit into
mainfrom
frenck/vote
Oct 1, 2026
Merged

frenck merged 1 commit into
mainfrom
frenck/vote

Conversation

@frenck

@frenck frenck commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Breaking change

None. A new method.

Proposed change

Adds vote(uuid=...), for the vote endpoint the library did not cover. Votes are what makes a station rank higher; the API counts one vote per station from the same IP address every 10 minutes.

The API documents only the successful answer ({"ok": true, "message": "voted for station successfully"}), and shows ok as a boolean in one place and as a string in another. Both count as accepted. When ok is anything else, vote() raises a RadioBrowserError with the message from the API, so a caller can tell the user.

Not tested against the live API on purpose: that would cast a real vote in the public database. The tests cover both forms of an accepted and a refused vote, escaping of the UUID, and a broken response. Documented in the README, next to station_click().

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.

@frenck frenck added the new-feature New features or options. label Oct 1, 2026
Add vote(), which raises a RadioBrowserError with the message from the
API when it does not accept the vote.
@frenck
frenck merged commit c9bb78e into main Oct 1, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant