Update section timer and end of section note

This commit is contained in:
Keith Edmunds 2023-02-28 21:27:48 +00:00
parent bc06722633
commit 9d3743ceb5

View File

@ -2198,6 +2198,19 @@ class PlaylistTab(QTableWidget):
self.musicmuster.tabInfolist.open_in_songfacts(title)
def _update_note_text(self, playlist_row: PlaylistRows,
new_text: str) -> None:
"""Update note text"""
# Column to update is either HEADER_NOTES_COLUMN for a section
# header or the appropriate row_notes column for a track row
if playlist_row.track_id:
column = ROW_NOTES
else:
column = HEADER_NOTES_COLUMN
_ = self._set_item_text(playlist_row.row_number, column, new_text)
def _update_row(self, session, row: int, track: Tracks) -> None:
"""
Update the passed row with info from the passed track.
@ -2235,12 +2248,16 @@ class PlaylistTab(QTableWidget):
total_time = 0
total_time = sum([a.track.duration for a in plr_tracks])
import ipdb; ipdb.set_trace()
time_str = self._get_section_timing_string(total_time)
new_text = self._get_row_note(from_row) + time_str
_ = self._set_row_note(session, from_row, new_text)
self._update_note_text(from_plr, from_plr.note + time_str)
# Update section end
if plr.note.strip() == "-":
new_text = (
"[End " + from_plr.note.strip()[:-1].strip() + "]"
)
self._update_note_text(plr, new_text)
def _update_start_end_times(self) -> None:
""" Update track start and end times """