Implemented saving of playlists to disk.

This commit is contained in:
The Wobbler 2025-01-25 20:45:43 +01:00
parent a7fc19f98b
commit 1007ac045f
7 changed files with 62 additions and 12 deletions

View file

@ -98,3 +98,13 @@ class Playlist:
return self.current_track.sound, self.current_track.duration
def save(self):
wbz_data = ""
for track in self.tracks:
wbz_data += f"{track.path}\n"
wbz = open(f"{self.app.settings.library_path}/playlists/{self.title.replace(" ", "_")}.wbz.m3u", "w")
wbz.write(wbz_data)
wbz.close()