WIP V3: Don't hide next/current row
This commit is contained in:
parent
02391f04b1
commit
dfb45dd0ff
@ -1031,12 +1031,14 @@ class PlaylistModel(QAbstractTableModel):
|
||||
Set row_number as next track. If row_number is None, clear next track.
|
||||
"""
|
||||
|
||||
if row_number is None:
|
||||
next_row_was = track_sequence.next.plr_rownum
|
||||
if next_row_was is not None:
|
||||
self.invalidate_row(next_row_was)
|
||||
|
||||
if row_number is None:
|
||||
if next_row_was is None:
|
||||
return
|
||||
track_sequence.next = PlaylistTrack()
|
||||
self.invalidate_row(next_row_was)
|
||||
self.signals.next_track_changed_signal.emit()
|
||||
return
|
||||
|
||||
@ -1265,6 +1267,22 @@ class PlaylistProxyModel(QSortFilterProxyModel):
|
||||
|
||||
if self.playlist_model.played_tracks_hidden:
|
||||
if self.playlist_model.is_played_row(source_row):
|
||||
# Don't hide current or next track
|
||||
with Session() as session:
|
||||
next_plr = session.get(PlaylistRows, track_sequence.next.plr_id)
|
||||
if (
|
||||
next_plr
|
||||
and next_plr.plr_rownum == source_row
|
||||
and next_plr.playlist_id == self.playlist_model.playlist_id
|
||||
):
|
||||
return True
|
||||
now_plr = session.get(PlaylistRows, track_sequence.now.plr_id)
|
||||
if (
|
||||
now_plr
|
||||
and now_plr.plr_rownum == source_row
|
||||
and now_plr.playlist_id == self.playlist_model.playlist_id
|
||||
):
|
||||
return True
|
||||
return False
|
||||
return super().filterAcceptsRow(source_row, source_parent)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user