diff --git a/pomice/player.py b/pomice/player.py index 3f30eb2..bdfe276 100644 --- a/pomice/player.py +++ b/pomice/player.py @@ -196,6 +196,14 @@ class Player(VoiceProtocol): """Property which returns the player's position in a track in milliseconds adjusted for rate""" return self.position / self.rate + @property + def adjusted_length(self) -> float: + """Property which returns the player's track length in milliseconds adjusted for rate""" + if not self.is_playing: + return 0 + + return self.current.length / self.rate + @property def is_playing(self) -> bool: """Property which returns whether or not the player is actively playing a track."""