Add in_play_service.get_scores_and_broadcast (#569) - #623
Open
bensynapse wants to merge 1 commit into
Open
Conversation
Expose the in-play service scoresAndBroadcast endpoint, which returns the same data as scores plus broadcast availability (tv, radio, bfLiveVideo, live video / data visualization / paddock view flags) and sport-specific matchInfo. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Addresses #569.
Adds
in_play_service.get_scores_and_broadcast(), exposing the in-play servicescoresAndBroadcastendpoint. It returns everything/scoresdoes plus two extra blocks per event:broadcasts— tv listings (start/end time, channel), radio url,bfLiveVideo, and theisLiveVideoAvailable/isDataVisualizationAvailable/isPaddockViewAvailableflags + delivery channelmatchInfo— sport-specific info (e.g.surface/numberOfSetsfor tennis); since the fields vary by event type the raw dict is kept on_dataScoresAndBroadcastsubclassesScores, so all the existing score fields parse the same way, and the endpoint method mirrorsget_scores(same params,lightweightsupported).Prior art: @DanielTomaro13 attempted this in #616 — credit to them for picking it up. That branch imports a
ScoresAndBroadcastresource that was never added toinplayserviceresources.py(hence the red CI), and its fixture modelsbroadcastsas a list of provider objects, whereas the endpoint actually returns an object keyedtv/radio/bfLiveVideo+ flags (per the response screenshot in #569 and captures of the same payload elsewhere). This PR is a fresh implementation against that real shape — happy to close it in favour of finishing #616 if you'd rather go that way.Tested with a fixture matching the real response shape (
tests/resources/scoresandbroadcast.json) plus an endpoint test mirroringtest_get_scores; also covers a response withoutbroadcasts/matchInfo.black --checkand the full unittest suite pass locally (388 tests). Docs entry added todocs/endpoints.md.