Implemented renaming of playlists.
This commit is contained in:
parent
b2aa7ffd8c
commit
3e579a4fcb
3 changed files with 24 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue