Use new length position in SAO UI

This commit is contained in:
mars 2022-11-20 00:00:43 -07:00
parent 1fe366ce9f
commit 2df2bd3f8f
1 changed files with 6 additions and 6 deletions

View File

@ -336,17 +336,17 @@ impl MusicPlayerWidget {
.map(|s| s.as_str())
.unwrap_or("<album here>"),
);
if let Some(length) = info.length {
self.duration.set_text(&Self::format_time(length));
} else {
self.duration.set_text("--:--");
}
}
pub fn update_progress(&mut self, progress: ProgressChanged) {
self.position_secs = progress.position;
self.position_dirty = true;
if let Some(length) = progress.length {
self.duration.set_text(&Self::format_time(length));
} else {
self.duration.set_text("--:--");
}
}
pub fn update_playback_status(&mut self, status: PlaybackStatus) {