fix: address some type: ignore comments
This commit is contained in:
parent
9e9ab07ab5
commit
011315dc77
|
|
@ -200,10 +200,10 @@ class Player(VoiceProtocol):
|
||||||
@property
|
@property
|
||||||
def position(self) -> float:
|
def position(self) -> float:
|
||||||
"""Property which returns the player's position in a track in milliseconds"""
|
"""Property which returns the player's position in a track in milliseconds"""
|
||||||
if not self.is_playing:
|
if not self.is_playing or not self._current:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
current: Track = self._current # type: ignore
|
current: Track = self._current
|
||||||
if current.original:
|
if current.original:
|
||||||
current = current.original
|
current = current.original
|
||||||
|
|
||||||
|
|
@ -230,10 +230,10 @@ class Player(VoiceProtocol):
|
||||||
@property
|
@property
|
||||||
def adjusted_length(self) -> float:
|
def adjusted_length(self) -> float:
|
||||||
"""Property which returns the player's track length in milliseconds adjusted for rate"""
|
"""Property which returns the player's track length in milliseconds adjusted for rate"""
|
||||||
if not self.is_playing:
|
if not self.is_playing or not self._current:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
return self.current.length / self.rate # type: ignore
|
return self.current.length / self.rate
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_playing(self) -> bool:
|
def is_playing(self) -> bool:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue