From 44c9fafb2c06af5d12eb819856acd5e8ff043456 Mon Sep 17 00:00:00 2001 From: EKNr1 Date: Sat, 21 Dec 2024 19:14:17 +0100 Subject: [PATCH] Made the progress slider not be at the end when the track is paused and corrected the formula for setting the remaining time in unpause_track_progress_timer() --- wobuzz/gui_communication.py | 4 ++++ wobuzz/player/player.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wobuzz/gui_communication.py b/wobuzz/gui_communication.py index a5d19a4..08d6e2b 100644 --- a/wobuzz/gui_communication.py +++ b/wobuzz/gui_communication.py @@ -26,6 +26,10 @@ class GUICommunication: def update_progress(self): remaining = self.app.player.track_progress_timer.remainingTime() + + if remaining == -1: + remaining = self.app.player.remaining_time + track_duration = self.app.player.playing_track.duration progress = track_duration - remaining diff --git a/wobuzz/player/player.py b/wobuzz/player/player.py index e717c0e..9671c4c 100644 --- a/wobuzz/player/player.py +++ b/wobuzz/player/player.py @@ -111,5 +111,5 @@ class Player: self.track_progress_timer.stop() def unpause_track_progress_timer(self): - self.track_progress_timer.start(self.playing_track.duration - self.remaining_time) + self.track_progress_timer.start(self.remaining_time)