From 499c0c6b70ab977422625f74955e56500f8f96fc Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Fri, 14 Feb 2025 19:38:06 +0000 Subject: [PATCH] Fix "=" header Fixes: #276 --- app/playlistmodel.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/playlistmodel.py b/app/playlistmodel.py index 034c781..577533f 100644 --- a/app/playlistmodel.py +++ b/app/playlistmodel.py @@ -32,6 +32,7 @@ import obswebsocket # type: ignore # App imports from classes import ( + ApplicationError, Col, MusicMusterSignals, ) @@ -1281,10 +1282,10 @@ class PlaylistModel(QAbstractTableModel): # Show subtotal for row_number in range(rat.row_number - 1, -1, -1): row_rat = self.playlist_rows[row_number] - if self.is_header_row(row_number): - if row_rat.note.endswith(Config.SECTION_STARTS): + if self.is_header_row(row_number) or row_number == 0: + if row_rat.note.endswith(Config.SECTION_STARTS) or row_number == 0: # If we are playing this section, also - # calculate end time if all tracks are played. + # calculate end time when all tracks are played. end_time_str = "" if ( track_sequence.current @@ -1323,9 +1324,8 @@ class PlaylistModel(QAbstractTableModel): unplayed_count += 1 duration += row_rat.duration - # We should only get here if there were no rows in section (ie, - # this was row zero) - return Config.SUBTOTAL_ON_ROW_ZERO + # We should never get here + raise ApplicationError("Error in section_subtotal_header()") def selection_is_sortable(self, row_numbers: list[int]) -> bool: """