More track timing cleanups

This commit is contained in:
Keith Edmunds 2024-07-22 18:47:29 +01:00
parent 3c884e54ca
commit 7658dc354c

View File

@ -1477,13 +1477,10 @@ class PlaylistModel(QAbstractTableModel):
# Update current track details now so that they are available
# when we deal with next track row which may be above current
# track row.
self.playlist_rows[
current_track_row
].start_time = track_sequence.current.start_time
self.playlist_rows[
current_track_row
].end_time = track_sequence.current.end_time
update_rows.append(current_track_row)
self.playlist_rows[current_track_row].set_start(
update_rows, track_sequence.current.start_time
)
if track_sequence.next:
next_track_row = track_sequence.next.row_number
@ -1494,8 +1491,8 @@ class PlaylistModel(QAbstractTableModel):
# unreadable tracks or for the current track, handled above.
if (
prd.played
or row_number == current_track_row
or (prd.path and file_is_unreadable(prd.path))
or (current_track_row and row_number == current_track_row)
):
continue
@ -1508,12 +1505,13 @@ class PlaylistModel(QAbstractTableModel):
# Set start time for next row if we have a current track
if (
next_track_row
and row_number == next_track_row
row_number == next_track_row
and track_sequence.current
and track_sequence.current.end_time
):
next_start_time = prd.set_start(update_rows, track_sequence.current.end_time)
next_start_time = prd.set_start(
update_rows, track_sequence.current.end_time
)
continue
# If we're between the current and next row, zero out