Fixed some bugs that happened when tracks got rearranged.

This commit is contained in:
The Wobbler 2025-01-26 16:49:09 +01:00
parent b2bd8ef784
commit 519b2d0adb
10 changed files with 72 additions and 17 deletions

View file

@ -17,8 +17,8 @@ class Player:
self.track_progress = TrackProgress(self.app)
self.current_playlist = Playlist(self.app, "None")
self.history = Playlist(self.app, "History")
self.current_playlist = Playlist(self.app, "None")
self.playing = False
self.paused = False
@ -65,7 +65,7 @@ class Player:
self.history.append_track(self.current_playlist.current_track)
self.app.gui.on_track_change(None, self.current_playlist.current_track)
self.app.gui.on_track_change(self.history.h_last_track(), self.current_playlist.current_track)
self.app.gui.track_control.on_playstate_update()
@ -133,7 +133,9 @@ class Player:
def stop(self):
self.music_channel.stop()
self.track_progress.stop()
self.current_sound_duration = self.current_playlist.current_track.duration
if not self.current_playlist.current_track is None:
self.current_sound_duration = self.current_playlist.current_track.duration
self.playing = False
self.paused = False