fix: player skipping position
This commit is contained in:
parent
39bde67d06
commit
4ce4c6205f
|
|
@ -169,9 +169,7 @@ class Player(VoiceProtocol):
|
|||
if not self.is_playing or not self._current:
|
||||
return 0
|
||||
|
||||
current = self._current.original
|
||||
if not current:
|
||||
return 0
|
||||
current = getattr(self._current, "original", self._current)
|
||||
|
||||
if self.is_paused:
|
||||
return min(self._last_position, current.length)
|
||||
|
|
@ -241,7 +239,7 @@ class Player(VoiceProtocol):
|
|||
self._last_update = time.time() * 1000.0
|
||||
self._is_connected = bool(state.get("connected"))
|
||||
position = state.get("position")
|
||||
self._position = int(position) if position else 0
|
||||
self._last_position = int(position) if position else 0
|
||||
|
||||
async def _dispatch_voice_update(self, voice_data: Optional[Dict[str, Any]] = None) -> None:
|
||||
if {"sessionId", "event"} != self._voice_state.keys():
|
||||
|
|
|
|||
|
|
@ -119,11 +119,11 @@ class Node:
|
|||
self._session: aiohttp.ClientSession = session # type: ignore
|
||||
self._loop: asyncio.AbstractEventLoop = loop or asyncio.get_event_loop()
|
||||
self._websocket: aiohttp.ClientWebSocketResponse
|
||||
self._task: asyncio.Task
|
||||
self._task: asyncio.Task = None # type: ignore
|
||||
|
||||
self._session_id: Optional[str] = None
|
||||
self._available: bool = False
|
||||
self._version: int
|
||||
self._version: int = 0
|
||||
|
||||
self._route_planner = RoutePlanner(self)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue