From 105cc5ddf921056bedbbdf52ccf4b2a0c73ce11b Mon Sep 17 00:00:00 2001 From: The Wobbler Date: Fri, 28 Feb 2025 19:46:20 +0100 Subject: [PATCH] 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. --- wobuzz/player/playlist.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wobuzz/player/playlist.py b/wobuzz/player/playlist.py index 0734dcf..790d86b 100644 --- a/wobuzz/player/playlist.py +++ b/wobuzz/player/playlist.py @@ -295,6 +295,10 @@ class Playlist: 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 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 track.delete_items(self) + # make sure the playlist is not referenced as the temporary playlist if self == self.app.library.temporary_playlist: self.app.library.temporary_playlist = None