Fixed a bug where a playlist gets deleted on load of another playlist.
The bug occurred because the temporary playlist gets deleted when a new playlist gets loaded and I forgot to add code that sets the temporary playlist back to None when the temporary playlist gets renamed.
This commit is contained in:
parent
582448a024
commit
105cc5ddf9
1 changed files with 5 additions and 0 deletions
|
@ -295,6 +295,10 @@ class Playlist:
|
||||||
f"{self.app.settings.library_path}/playlists/{self.title.replace(" ", "_")}.wbz.m3u"
|
f"{self.app.settings.library_path}/playlists/{self.title.replace(" ", "_")}.wbz.m3u"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# make sure the playlist is not referenced anymore as the temporary playlist
|
||||||
|
if self == self.app.library.temporary_playlist:
|
||||||
|
self.app.library.temporary_playlist = None
|
||||||
|
|
||||||
if not old_title == self.title: # remove only when the playlist actually has a different name
|
if not old_title == self.title: # remove only when the playlist actually has a different name
|
||||||
self.app.utils.unique_names.remove(old_title)
|
self.app.utils.unique_names.remove(old_title)
|
||||||
|
|
||||||
|
@ -312,6 +316,7 @@ class Playlist:
|
||||||
for track in self.tracks: # remove items that corresponded to the track and this playlist
|
for track in self.tracks: # remove items that corresponded to the track and this playlist
|
||||||
track.delete_items(self)
|
track.delete_items(self)
|
||||||
|
|
||||||
|
# make sure the playlist is not referenced as the temporary playlist
|
||||||
if self == self.app.library.temporary_playlist:
|
if self == self.app.library.temporary_playlist:
|
||||||
self.app.library.temporary_playlist = None
|
self.app.library.temporary_playlist = None
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue