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: if playlist:
playlist.mark_open() playlist.mark_open()
session.commit()
return playlist return playlist
else: else:
log.error("Failed to create playlist") log.error("Failed to create playlist")
@ -1019,11 +1020,11 @@ class Window(QMainWindow, Ui_MainWindow):
session, template, playlist_name session, template, playlist_name
) )
if playlist:
playlist.mark_open()
# Need to ensure that the new playlist is committed to # Need to ensure that the new playlist is committed to
# the database before it is opened by the model. # the database before it is opened by the model.
session.commit() session.commit()
if playlist:
playlist.mark_open()
self.create_playlist_tab(playlist) self.create_playlist_tab(playlist)
else: else:
log.error("Playlist failed to create") log.error("Playlist failed to create")