Fix bug storing open tabs
This commit is contained in:
parent
71e76e02d1
commit
36e28ca4f4
@ -201,10 +201,11 @@ class Playlists(dbtables.PlaylistsTable):
|
||||
update(Playlists).where((Playlists.id.in_(playlist_ids))).values(tab=None)
|
||||
)
|
||||
|
||||
def close(self) -> None:
|
||||
def close(self, session: Session) -> None:
|
||||
"""Mark playlist as unloaded"""
|
||||
|
||||
self.open = False
|
||||
session.commit()
|
||||
|
||||
@classmethod
|
||||
def create_playlist_from_template(
|
||||
|
||||
@ -496,7 +496,6 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
if playlist:
|
||||
log.debug(f"Set {playlist=} tab to {idx=}")
|
||||
playlist.tab = idx
|
||||
session.flush()
|
||||
|
||||
# Save current tab
|
||||
record = settings["active_tab"]
|
||||
@ -533,7 +532,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
with db.Session() as session:
|
||||
playlist = session.get(Playlists, closing_tab_playlist_id)
|
||||
if playlist:
|
||||
playlist.close()
|
||||
playlist.close(session)
|
||||
|
||||
# Close playlist and remove tab
|
||||
self.tabPlaylist.widget(tab_index).close()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user