From 4af1d4906c85dd34edbebef6205f20a11830720f Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Tue, 7 Mar 2023 18:02:00 +0000 Subject: [PATCH] Never hide current or next row --- app/playlists.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/playlists.py b/app/playlists.py index 904227b..43847aa 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -494,7 +494,14 @@ class PlaylistTab(QTableWidget): return [plr for plr in plrs if plr is not None] def hide_played_tracks(self, hide: bool) -> None: - """Hide played tracks if hide is True else show them""" + """ + Hide played tracks if hide is True else show them + + Never hide current or next track + """ + + current_next = [self._get_current_track_row_number(), + self._get_next_track_row_number()] with Session() as session: played = [ @@ -502,6 +509,8 @@ class PlaylistTab(QTableWidget): session, self.playlist_id) ] for row in range(self.rowCount()): + if row in current_next: + continue if row in played: if hide: self.hideRow(row)