From 6391490f9de2c88c1b358defdca6a067170d3234 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Thu, 7 Dec 2023 23:04:25 +0000 Subject: [PATCH] Select next track after header Fixes #209 --- app/playlistmodel.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/playlistmodel.py b/app/playlistmodel.py index 0eb3469..715f95e 100644 --- a/app/playlistmodel.py +++ b/app/playlistmodel.py @@ -306,7 +306,13 @@ class PlaylistModel(QAbstractTableModel): if unplayed_rows: try: # Find next row after current track - next_row = min([a for a in unplayed_rows if a > row_number]) + next_row = min( + [ + a + for a in unplayed_rows + if a > row_number and not self.is_header_row(a) + ] + ) except ValueError: # Find first unplayed track next_row = min(unplayed_rows)