forked from Wobbl/Wobuzz
Implemented saving of playlists to disk.
This commit is contained in:
parent
a7fc19f98b
commit
1007ac045f
7 changed files with 62 additions and 12 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue