From 1cc1f1a185fb5e8be63bb4087ab5ac49bc9680f5 Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Mon, 6 Feb 2023 21:51:53 +0000 Subject: [PATCH] Display ampersands correctly in header Fixes #165 --- app/musicmuster.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/musicmuster.py b/app/musicmuster.py index ecb2359..94c114c 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -1565,21 +1565,26 @@ class Window(QMainWindow, Ui_MainWindow): Update last / current / next track headers """ - if self.previous_track.title: + if self.previous_track.title and self.previous_track.artist: self.hdrPreviousTrack.setText( - f"{self.previous_track.title} - {self.previous_track.artist}") + f"{self.previous_track.title.replace('&', '&&')} - " + f"{self.previous_track.artist.replace('&', '&&')}" + ) else: self.hdrPreviousTrack.setText("") - if self.current_track.title: + if self.current_track.title and self.current_track.artist: self.hdrCurrentTrack.setText( - f"{self.current_track.title} - {self.current_track.artist}") + f"{self.current_track.title.replace('&', '&&')} - " + f"{self.current_track.artist.replace('&', '&&')}" + ) else: self.hdrCurrentTrack.setText("") - if self.next_track.title: + if self.next_track.title and self.next_track.artist: self.hdrNextTrack.setText( - f"{self.next_track.title} - {self.next_track.artist}" + f"{self.next_track.title.replace('&', '&&')} - " + f"{self.next_track.artist.replace('&', '&&')}" ) else: self.hdrNextTrack.setText("")