Compare commits
No commits in common. "fa52b7ffafea04b6dc09eb31d10a2898441ccff6" and "f2d01e003d05a518051b7aeb4ab9357d845480d5" have entirely different histories.
fa52b7ffaf
...
f2d01e003d
@ -201,11 +201,10 @@ class Playlists(dbtables.PlaylistsTable):
|
|||||||
update(Playlists).where((Playlists.id.in_(playlist_ids))).values(tab=None)
|
update(Playlists).where((Playlists.id.in_(playlist_ids))).values(tab=None)
|
||||||
)
|
)
|
||||||
|
|
||||||
def close(self, session: Session) -> None:
|
def close(self) -> None:
|
||||||
"""Mark playlist as unloaded"""
|
"""Mark playlist as unloaded"""
|
||||||
|
|
||||||
self.open = False
|
self.open = False
|
||||||
session.commit()
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def create_playlist_from_template(
|
def create_playlist_from_template(
|
||||||
|
|||||||
@ -496,6 +496,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
if playlist:
|
if playlist:
|
||||||
log.debug(f"Set {playlist=} tab to {idx=}")
|
log.debug(f"Set {playlist=} tab to {idx=}")
|
||||||
playlist.tab = idx
|
playlist.tab = idx
|
||||||
|
session.flush()
|
||||||
|
|
||||||
# Save current tab
|
# Save current tab
|
||||||
record = settings["active_tab"]
|
record = settings["active_tab"]
|
||||||
@ -532,7 +533,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
with db.Session() as session:
|
with db.Session() as session:
|
||||||
playlist = session.get(Playlists, closing_tab_playlist_id)
|
playlist = session.get(Playlists, closing_tab_playlist_id)
|
||||||
if playlist:
|
if playlist:
|
||||||
playlist.close(session)
|
playlist.close()
|
||||||
|
|
||||||
# Close playlist and remove tab
|
# Close playlist and remove tab
|
||||||
self.tabPlaylist.widget(tab_index).close()
|
self.tabPlaylist.widget(tab_index).close()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user