subclient

Subsonic ncurses client
git clone https://git.e1e0.net/subclient.git
Log | Files | Refs | README

commit 3fc4f398b4b0cc5996129c16c07d92cb6d76e133
parent 42e51ec5f95795bb43d507a0fbdc1951b0c19c2c
Author: Paco Esteban <paco@e1e0.net>
Date:   Thu, 21 Oct 2021 21:13:04 +0200

fix playlist pos -1 and paused icon at start

Diffstat:
Msubclient/player.py | 7++++++-
Msubclient/subclient.py | 2+-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/subclient/player.py b/subclient/player.py @@ -40,6 +40,9 @@ class Player: def is_paused(self): return self.mpv.pause + def is_idle(self): + return self.mpv.core_idle + def set_pause(self, state): self.mpv.pause = state @@ -68,7 +71,9 @@ class Player: def get_list_info(self): playlist_total = self.mpv.playlist_count playlist_pos = self.mpv.playlist_pos_1 - if playlist_total is None or playlist_pos is None: + if (playlist_total is None + or playlist_pos is None + or playlist_pos == -1): return ' ' return f'{playlist_pos} of {playlist_total}' diff --git a/subclient/subclient.py b/subclient/subclient.py @@ -241,7 +241,7 @@ class SubClient: list_info = self.player.get_list_info() song_info = self.player.get_song_info() duration_info = self.player.get_duration_info() - if self.player.is_paused(): + if self.player.is_paused() or self.player.is_idle(): icon = '|| ' else: icon = '> '