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,8 +18,7 @@ class Library:
self.main_library_dock = LibraryDock(self)
self.library_docks = [self.main_library_dock]
self.temporary_playlist = Playlist(self.app, "Temporary Playlist")
self.playlists = [self.temporary_playlist]
self.playlists = []
def load(self):
path_playlists = os.path.expanduser(f"{self.app.settings.library_path}/playlists")
@ -37,12 +36,8 @@ class Library:
if file_name.endswith(".m3u"):
path = f"{path_playlists}/{file_name}"
if file_name == "Temporary_Playlist.wbz.m3u":
playlist = self.temporary_playlist
else:
playlist = Playlist(self.app, file_name.replace("_", " ").split(".")[0])
self.playlists.append(playlist)
playlist = Playlist(self.app, file_name.replace("_", " ").split(".")[0])
self.playlists.append(playlist)
playlist.load_from_m3u(path)
@ -62,6 +57,9 @@ class Library:
for playlist in self.playlists:
playlist.save()
if self.app.player.current_playlist is not None:
self.app.settings.latest_playlist = self.app.player.current_playlist.path
def new_playlist(self):
playlist = Playlist(self.app, self.app.utils.unique_name("New Playlist"))
self.playlists.append(playlist)