Implemented renaming of playlists.

This commit is contained in:
The Wobbler 2025-01-27 18:18:41 +01:00
parent b2aa7ffd8c
commit 3e579a4fcb
3 changed files with 24 additions and 4 deletions

View file

@ -114,10 +114,22 @@ class Playlist:
for track in self.tracks:
wbz_data += f"{track.path}\n"
wbz = open(os.path.expanduser(f"{self.app.settings.library_path}/playlists/{self.title.replace(" ", "_")}.wbz.m3u"), "w")
wbz = open(
os.path.expanduser(
f"{self.app.settings.library_path}/playlists/{self.title.replace(" ", "_")}.wbz.m3u"
),
"w"
)
wbz.write(wbz_data)
wbz.close()
def delete(self):
os.remove(
os.path.expanduser(
f"{self.app.settings.library_path}/playlists/{self.title.replace(" ", "_")}.wbz.m3u"
),
)
def append_track(self, track):
self.tracks.append(track)