Repository navigation
Get the check and click history of stations - #1585
Merged
Merged
Conversation
Add checks() and clicks(), with StationCheck and StationClick models, for the check and click history of one station or of all stations.
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. Two new methods and two new models.
Proposed change
Adds the station history endpoints the API documents:
checks()returns the checks the Radio Browser servers run on stations: whether a stream was online, its codec and bitrate, what the stream reports about itself, and how long it took. With a station UUID, it is that station's history, which helps to find out why a stream does not play. Without one, it is the latest check of every station.clicks()returns when stations were played.Both take
uuid,seconds(only the last so many seconds),limit, andafterto continue after the UUID of an earlier check or click, which is how the API pages through these lists. A negativelimitorsecondsraises aValueError.The new
StationCheckandStationClickmodels only require the fields a check or click always has. Checked against 200 live check results: everything a stream reports about itself (name, tags, country, homepage, favicon, location and more) can benull, so those fields default toNoneor an empty list.CommaSeparatedStringnow acceptsnullfor that reason.Live: the last 30 days of checks for a station come back as expected, and
after=continues right after the last click of an earlier call. Documented in a new "Station history" section of the README.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).