diff --git a/app/musicmuster.py b/app/musicmuster.py index df01f68..d799124 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -722,17 +722,20 @@ class Window(QMainWindow, Ui_MainWindow): # doesn't see player=None and kick off end-of-track actions self.playing = False + # Remove currently playing track colour + if ( + self.current_track and + self.current_track.playlist_tab and + self.current_track.plr_id + ): + self.current_track.playlist_tab.reset_plr_row_colour( + self.current_track.plr_id) + # Reset PlaylistTrack objects if self.current_track.track_id: self.previous_track = self.current_track self.current_track = PlaylistTrack() - # Repaint playlist to remove currently playing track colour - # What was current track is now previous track - with Session() as session: - if self.previous_track.playlist_tab: - self.previous_track.playlist_tab.update_display(session) - # Reset clocks self.frame_fade.setStyleSheet("") self.frame_silent.setStyleSheet("") diff --git a/app/playlists.py b/app/playlists.py index 1c4eeae..7ac73a1 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -830,6 +830,15 @@ class PlaylistTab(QTableWidget): # Reset drag mode self.setDragEnabled(False) + def reset_plr_row_colour(self, plr_id: int) -> None: + """Reset background of row pointed to by plr_id""" + + row = self._plrid_to_row_number(plr_id) + if not row: + return + + self._set_row_colour(row, None) + def save_playlist(self, session: scoped_session) -> None: """ Get the PlaylistRow objects for each row in the display. Correct