Fix bug moving unplayed tracks between playlists

This commit is contained in:
Keith Edmunds 2023-12-22 08:14:51 +00:00
parent c6a0e8c749
commit 91cef9e506

View File

@ -877,18 +877,16 @@ class PlaylistModel(QAbstractTableModel):
self.invalidate_rows(list(row_map.keys())) self.invalidate_rows(list(row_map.keys()))
def move_rows_between_playlists( def move_rows_between_playlists(
self, from_rows: List[int], to_row_number: int, to_playlist_model: PlaylistModel self, from_rows: List[int], to_row_number: int, to_playlist_id: int
) -> None: ) -> None:
""" """
Move the playlist rows given to to_row and below of to_playlist. Move the playlist rows given to to_row and below of to_playlist.
""" """
log.info( log.info(
f"move_rows_between_playlists({from_rows=}, {to_row_number=}, {to_playlist_model=}" f"move_rows_between_playlists({from_rows=}, {to_row_number=}, {to_playlist_id=}"
) )
to_playlist_id = to_playlist_model.playlist_id
# Row removal must be wrapped in beginRemoveRows .. # Row removal must be wrapped in beginRemoveRows ..
# endRemoveRows and the row range must be contiguous. Process # endRemoveRows and the row range must be contiguous. Process
# the highest rows first so the lower row numbers are unchanged # the highest rows first so the lower row numbers are unchanged