Display ampersands correctly in header

Fixes #165
This commit is contained in:
Keith Edmunds 2023-02-06 21:51:53 +00:00
parent 4a6d6fa208
commit 1cc1f1a185

View File

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