From 27261ff871c95c15ca088f88d1fe0c8270f9365e Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Fri, 6 Dec 2024 21:55:04 +0000 Subject: [PATCH] Only highlight current/next track in correct playlist Fixes #259 --- app/playlistmodel.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/playlistmodel.py b/app/playlistmodel.py index 6719027..977e3c4 100644 --- a/app/playlistmodel.py +++ b/app/playlistmodel.py @@ -155,10 +155,18 @@ class PlaylistModel(QAbstractTableModel): if file_is_unreadable(rat.path): return QBrush(QColor(Config.COLOUR_UNREADABLE)) # Current track - if track_sequence.current and track_sequence.current.row_number == row: + if ( + track_sequence.current + and track_sequence.current.playlist_id == self.playlist_id + and track_sequence.current.row_number == row + ): return QBrush(QColor(Config.COLOUR_CURRENT_PLAYLIST)) # Next track - if track_sequence.next and track_sequence.next.row_number == row: + if ( + track_sequence.next + and track_sequence.next.playlist_id == self.playlist_id + and track_sequence.next.row_number == row + ): return QBrush(QColor(Config.COLOUR_NEXT_PLAYLIST)) # Individual cell colouring