Removed some mechanic that is going to be reimplemented.

This commit is contained in:
The Wobbler 2025-02-03 17:53:35 +01:00
parent 67d353dcef
commit bedca22ca6
9 changed files with 24 additions and 28 deletions

View file

@ -18,7 +18,7 @@ class Player:
self.track_progress = TrackProgress(self.app)
self.history = Playlist(self.app, "History")
self.current_playlist = Playlist(self.app, "None")
self.current_playlist = None
self.playing = False
self.paused = False
@ -134,7 +134,7 @@ class Player:
self.music_channel.stop()
self.track_progress.stop()
if not self.current_playlist.current_track is None:
if self.current_playlist is not None and self.current_playlist.current_track is not None:
self.current_sound_duration = self.current_playlist.current_track.duration
self.playing = False

View file

@ -72,8 +72,6 @@ class Playlist:
if self.current_track is None and self.has_tracks():
self.current_track = self.tracks[0]
#self.app.player.history.append_track(self.current_track)
def load_from_wbz(self, path):
pass

View file

@ -48,13 +48,14 @@ class Track:
If this track is the currently playing track, and it gets moved, this corrects the current playlist index.
"""
if self.app.player.current_playlist.current_track is self:
for item in self.items:
if (
item.playlist in self.occurrences and
self.occurrences[item.playlist][id(item)] == self.app.player.current_playlist.current_track_index
):
self.app.player.current_playlist.set_track(new_occurrences[item.playlist][id(item)])
if self.app.player.current_playlist is not None:
if self.app.player.current_playlist.current_track is self:
for item in self.items:
if (
item.playlist in self.occurrences and
self.occurrences[item.playlist][id(item)] == self.app.player.current_playlist.current_track_index
):
self.app.player.current_playlist.set_track(new_occurrences[item.playlist][id(item)])
def cache(self):
self.load_audio()

View file

@ -30,5 +30,5 @@ class TrackProgress:
def stop(self):
self.timer.stop()
if not self.app.player.current_playlist.current_track is None:
if self.app.player.current_playlist is not None and self.app.player.current_playlist.current_track is not None:
self.remaining_time = self.app.player.current_playlist.current_track.duration