Fix clocks for resumed track

This commit is contained in:
Keith Edmunds 2023-07-09 23:19:27 +01:00
parent 2ca1d30609
commit da267562ea

View File

@ -1399,6 +1399,12 @@ class Window(QMainWindow, Ui_MainWindow):
)
self.play_next(self.previous_track_position)
# Adjust track info so that clocks and graph are correct.
# Easiest way is to fake the start time.
if self.current_track.start_time and self.current_track.duration:
elapsed_ms = self.current_track.duration * self.previous_track_position
self.current_track.start_time -= timedelta(milliseconds=elapsed_ms)
# If a track was playing when we were called, get details to
# set it as the next track
if playing_track: