Skip to content

Add in_play_service.get_scores_and_broadcast (#569) - #623

Open
bensynapse wants to merge 1 commit into
betcode-org:masterfrom
bensynapse:expose-inplay-service-data
Open

Add in_play_service.get_scores_and_broadcast (#569)#623
bensynapse wants to merge 1 commit into
betcode-org:masterfrom
bensynapse:expose-inplay-service-data

Conversation

@bensynapse

Copy link
Copy Markdown

Addresses #569.

Adds in_play_service.get_scores_and_broadcast(), exposing the in-play service scoresAndBroadcast endpoint. It returns everything /scores does plus two extra blocks per event:

  • broadcasts — tv listings (start/end time, channel), radio url, bfLiveVideo, and the isLiveVideoAvailable / isDataVisualizationAvailable / isPaddockViewAvailable flags + delivery channel
  • matchInfo — sport-specific info (e.g. surface / numberOfSets for tennis); since the fields vary by event type the raw dict is kept on _data

ScoresAndBroadcast subclasses Scores, so all the existing score fields parse the same way, and the endpoint method mirrors get_scores (same params, lightweight supported).

Prior art: @DanielTomaro13 attempted this in #616 — credit to them for picking it up. That branch imports a ScoresAndBroadcast resource that was never added to inplayserviceresources.py (hence the red CI), and its fixture models broadcasts as a list of provider objects, whereas the endpoint actually returns an object keyed tv/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 mirroring test_get_scores; also covers a response without broadcasts/matchInfo. black --check and the full unittest suite pass locally (388 tests). Docs entry added to docs/endpoints.md.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant