Skip to content

Commit

Permalink
fix(player): resolve issue with resuming unknown players
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 committed Jun 2, 2023
1 parent 8562988 commit b450e08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions mafic/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,7 @@ async def _add_unknown_player(self, player_id: int, state: PlayerPayload) -> Non
player = Player(self.client, channel)

player.set_state(state)
player._node = self # pyright: ignore[reportPrivateUsage]

self._players[player_id] = player

Expand Down
2 changes: 1 addition & 1 deletion mafic/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def set_state(self, state: PlayerPayload) -> None:
You should not need to use this.
"""
self._session_id = state["voice"]["sessionId"]
self._ping = state["voice"]["ping"]
self._ping = state["voice"].get("ping", -1)
self._current = (
Track.from_data_with_info(state["track"]) if state["track"] else None
)
Expand Down

0 comments on commit b450e08

Please sign in to comment.