Further fixes to moving tracks between playlists

Fixes: #38
This commit is contained in:
Keith Edmunds 2021-09-10 11:48:30 +01:00
parent c69aefef92
commit d5d4361ec5
2 changed files with 5 additions and 0 deletions

View File

@ -338,6 +338,7 @@ class PlaylistTracks(Base):
f"PlaylistTracks.playlist_id == {from_playlist_id}, "
f"PlaylistTracks.row == {row}"
)
return
record.playlist_id = to_playlist_id
record.row = new_row
session.commit()

View File

@ -423,6 +423,9 @@ class PlaylistTab(QTableWidget):
# on its specified row, only that it will be above
# larger-numbered row items, and below lower-numbered ones.
# That means we need to re-save ourself once loaded to ensure
# database is correct.
# First, save our id for the future
self.id = playlist_db.id
self.name = playlist_db.name
@ -449,6 +452,7 @@ class PlaylistTab(QTableWidget):
scroll_to = self.item(0, self.COL_INDEX)
self.scrollToItem(scroll_to, QAbstractItemView.PositionAtTop)
self._save_playlist(session)
self._repaint()
def repaint(self):