Save sorted selection

This commit is contained in:
Keith Edmunds 2023-10-10 01:28:31 +01:00
parent 8e2edb6af3
commit 06e457a3da

View File

@ -2270,7 +2270,6 @@ class PlaylistTab(QTableWidget):
sort_item = self.item(index.row(), sort_column)
if sort_item:
sorted_rows.append((index.row(), sort_item.text()))
print(f"{sort_item.text()=}")
# Sort the list
sorted_rows.sort(key=lambda row: row[1])
@ -2289,9 +2288,9 @@ class PlaylistTab(QTableWidget):
self.removeRow(i.row())
# Save playlist
# with Session() as session:
# self.save_playlist(session)
# self._update_start_end_times(session)
with Session() as session:
self.save_playlist(session)
self._update_start_end_times(session)
def _track_time_between_rows(
self, session: scoped_session, from_plr: PlaylistRows, to_plr: PlaylistRows