diff --git a/wobuzz/gui_communication.py b/wobuzz/gui_communication.py index d8612fa..58eeca3 100644 --- a/wobuzz/gui_communication.py +++ b/wobuzz/gui_communication.py @@ -38,19 +38,20 @@ class GUICommunication: self.app.player.seek(self.track_control.track_progress_slider.value()) def on_track_start(self): - duration = self.app.player.playing_track.duration + if self.app.player.playing: + duration = self.app.player.playing_track.duration - self.track_control.track_progress_slider.setRange( - 0, - duration - ) + self.track_control.track_progress_slider.setRange( + 0, + duration + ) - self.track_control.track_length_indicator.setText(self.app.utils.format_time(duration)) + self.track_control.track_length_indicator.setText(self.app.utils.format_time(duration)) - self.update_progress() + self.update_progress() def update_progress(self): - if not self.track_progress_slider_dragged: + if self.app.player.playing and not self.track_progress_slider_dragged: remaining = self.app.player.track_progress.timer.remainingTime() if remaining == -1: diff --git a/wobuzz/main.py b/wobuzz/main.py index acec06a..9f573ec 100644 --- a/wobuzz/main.py +++ b/wobuzz/main.py @@ -3,7 +3,7 @@ import sys from PyQt6.QtWidgets import QApplication from utils import Utils -from wobuzz.player.player import Player +from player.player import Player from gui import GUI from gui_communication import GUICommunication diff --git a/wobuzz/player/player.py b/wobuzz/player/player.py index 5400780..b800e43 100644 --- a/wobuzz/player/player.py +++ b/wobuzz/player/player.py @@ -2,7 +2,6 @@ import os -from PyQt6.QtCore import QTimer import pygame.mixer import pygame.event from .track import Track @@ -23,7 +22,7 @@ class Player: self.searched = False if not file_paths: - pass + self.current_playlist = [] # loading of last opened files will be implemented in the future else: