Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for client.broadcasts.push_pgn_update and client.broadcasts.update_round. #96

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ To be released
* Added ``sheet`` optional parameter to ``Tournaments.stream_results``, and fix returned typed dict.
* Added ``studies.import_pgn`` to import PGN to study
* Added ``tv.stream_current_game_of_channel`` to stream the current TV game of a channel
* Fixed ``client.broadcasts.push_pgn_update`` endpoint URL.
* Updated ``finished`` patameter to ``status`` in ``client.broadcasts.update_round``.

Thanks to @nicvagn, @tors42, @fitztrev and @trevorbayless for their contributions to this release.
Thanks to @nicvagn, @tors42, @fitztrev, @trevorbayless and @Looki2000 for their contributions to this release.

v0.13.2 (2023-12-04)
--------------------
Expand Down
8 changes: 4 additions & 4 deletions berserk/clients/broadcasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def push_pgn_update(self, broadcast_round_id: str, pgn_games: List[str]) -> None
:param broadcast_round_id: ID of a broadcast round
:param pgn_games: one or more games in PGN format
"""
path = f"/broadcast/round/{broadcast_round_id}/push"
path = f"/api/broadcast/round/{broadcast_round_id}/push"
games = "\n\n".join(g.strip() for g in pgn_games)
self._r.post(path, data=games)

Expand Down Expand Up @@ -171,8 +171,8 @@ def update_round(
syncUrlRound: str | None = None,
startsAt: int | None = None,
delay: int | None = None,
status: str | None = None,
period: int | None = None,
finished: bool | None = None,
) -> Dict[str, Any]:
"""Update information about a broadcast round that you created.

Expand All @@ -182,8 +182,8 @@ def update_round(
:param syncUrlRound: required if syncUrl contains a LiveChessCloud link
:param startsAt: Timestamp in milliseconds of broadcast round start
:param delay: how long to delay moves coming from the source in seconds
:param status: manual broadcast round status "new", "started" or "finished"
:param period: how long to wait between source requests in seconds
:param finished: set whether the round is completed
:return: updated broadcast information
"""
path = f"/broadcast/round/{broadcast_id}/edit"
Expand All @@ -193,8 +193,8 @@ def update_round(
"syncUrlRound": syncUrlRound,
"startsAt": startsAt,
"delay": delay,
"status": status,
"period": period,
"finished": finished,
}
return self._r.post(path, json=payload, converter=models.Broadcast.convert)

Expand Down
Loading