From 2ce7f671bafcc7fb62fa6c4177a0d93c33c05dbb Mon Sep 17 00:00:00 2001 From: Keith Edmunds Date: Sun, 27 Oct 2024 19:35:41 +0000 Subject: [PATCH] Ensure new playlists are marked as open --- app/musicmuster.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/musicmuster.py b/app/musicmuster.py index 950f340..800eb1e 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -534,6 +534,7 @@ class Window(QMainWindow, Ui_MainWindow): if playlist: playlist.mark_open() + session.commit() return playlist else: log.error("Failed to create playlist") @@ -1019,11 +1020,11 @@ class Window(QMainWindow, Ui_MainWindow): session, template, playlist_name ) - # Need to ensure that the new playlist is committed to - # the database before it is opened by the model. - session.commit() if playlist: playlist.mark_open() + # Need to ensure that the new playlist is committed to + # the database before it is opened by the model. + session.commit() self.create_playlist_tab(playlist) else: log.error("Playlist failed to create")