Never hide current or next row

This commit is contained in:
Keith Edmunds 2023-03-07 18:02:00 +00:00
parent ea5e4a2215
commit 4af1d4906c

View File

@ -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)