Ensure new playlists are marked as open

This commit is contained in:
Keith Edmunds 2024-10-27 19:35:41 +00:00
parent 2fb1974598
commit 2ce7f671ba

View File

@ -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")