From 42daac7ba375f8fb323bc80914a7fa1c164c0b84 Mon Sep 17 00:00:00 2001 From: spifory Date: Wed, 18 Oct 2023 19:05:29 +0200 Subject: [PATCH 1/3] feat(player): add `is_playing` helper --- mafic/player.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mafic/player.py b/mafic/player.py index 2c7789a..590e30a 100644 --- a/mafic/player.py +++ b/mafic/player.py @@ -212,6 +212,10 @@ def is_connected(self) -> bool: This is an alias for :attr:`connected`. """ return self._connected + + def is_playing(self) -> bool: + """Whether the player is playing anything.""" + return self.current is None async def _dispatch_player_update(self) -> None: """Dispatch a player update to the node.""" From ec2facdc018dabeb96b37e002a80960b34510dec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:10:49 +0000 Subject: [PATCH 2/3] style: auto fixes from pre-commit hooks --- mafic/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mafic/player.py b/mafic/player.py index 590e30a..859510f 100644 --- a/mafic/player.py +++ b/mafic/player.py @@ -212,7 +212,7 @@ def is_connected(self) -> bool: This is an alias for :attr:`connected`. """ return self._connected - + def is_playing(self) -> bool: """Whether the player is playing anything.""" return self.current is None From 8512039c4c25d0a92c8b93a1598bf8cfb55d28f7 Mon Sep 17 00:00:00 2001 From: Luvuyo Khumalo-Silubane Date: Tue, 19 Dec 2023 12:21:26 +0200 Subject: [PATCH 3/3] fix!: check if there is no current track --- mafic/player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mafic/player.py b/mafic/player.py index 859510f..fac2885 100644 --- a/mafic/player.py +++ b/mafic/player.py @@ -215,7 +215,7 @@ def is_connected(self) -> bool: def is_playing(self) -> bool: """Whether the player is playing anything.""" - return self.current is None + return self.current is not None async def _dispatch_player_update(self) -> None: """Dispatch a player update to the node."""