From 011315dc77e5ea1cc9f55d01e7a278a14427858e Mon Sep 17 00:00:00 2001 From: NiceAesth Date: Fri, 23 Feb 2024 14:18:10 +0200 Subject: [PATCH] fix: address some type: ignore comments --- pomice/player.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pomice/player.py b/pomice/player.py index 50fdfba..4cd005b 100644 --- a/pomice/player.py +++ b/pomice/player.py @@ -200,10 +200,10 @@ class Player(VoiceProtocol): @property def position(self) -> float: """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 - current: Track = self._current # type: ignore + current: Track = self._current if current.original: current = current.original @@ -230,10 +230,10 @@ class Player(VoiceProtocol): @property def adjusted_length(self) -> float: """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 self.current.length / self.rate # type: ignore + return self.current.length / self.rate @property def is_playing(self) -> bool: