Fix moving rows between playlists
This commit is contained in:
parent
8de9bf0d6e
commit
d3999ca63d
@ -1045,7 +1045,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
if self.move_source_rows is None or self.move_source_model is None:
|
||||
return
|
||||
|
||||
to_playlist_model = self.active_tab().source_model
|
||||
to_playlist_model: PlaylistModel = self.active_tab().source_model
|
||||
selected_rows = self.active_tab().get_selected_rows()
|
||||
if selected_rows:
|
||||
destination_row = selected_rows[0]
|
||||
@ -1059,7 +1059,7 @@ class Window(QMainWindow, Ui_MainWindow):
|
||||
self.move_source_model.move_rows(self.move_source_rows, destination_row)
|
||||
else:
|
||||
self.move_source_model.move_rows_between_playlists(
|
||||
self.move_source_rows, destination_row, to_playlist_model
|
||||
self.move_source_rows, destination_row, to_playlist_model.playlist_id
|
||||
)
|
||||
self.active_tab().clear_selection()
|
||||
|
||||
|
||||
@ -440,7 +440,10 @@ class PlaylistModel(QAbstractTableModel):
|
||||
End model reset if this is our playlist
|
||||
"""
|
||||
|
||||
log.debug(f"end_reset_model({playlist_id=})")
|
||||
|
||||
if playlist_id != self.playlist_id:
|
||||
log.debug(f"end_reset_model: not us ({self.playlist_id=})")
|
||||
return
|
||||
with Session() as session:
|
||||
self.refresh_data(session)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user