Tracks: avoid re-sorting table when purging/hiding tracks#15872
Merged
daschuer merged 1 commit intomixxxdj:2.5from Jan 19, 2026
Merged
Tracks: avoid re-sorting table when purging/hiding tracks#15872daschuer merged 1 commit intomixxxdj:2.5from
daschuer merged 1 commit intomixxxdj:2.5from
Conversation
daschuer
requested changes
Jan 18, 2026
Member
daschuer
left a comment
There was a problem hiding this comment.
The fix is reasonable.
This works for hiding, but now for delete form crates. Can you add it there as well?
Implemented for track models that don't have a position column (playlists) as that still requires rebuilding the row cache
67a7e2a to
1379c77
Compare
Member
Author
|
I also implemented it for crates and removed the debug stuff. |
daschuer
approved these changes
Jan 19, 2026
Member
daschuer
left a comment
There was a problem hiding this comment.
LGTM, and works nice. Thank you.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Should fix #12565
Reproduce the issue:
-> their "last played" values changes, track order is stable
-> table is resorted by "last played" :| sometimes also the selected index is lost
After purge/hide
BaseSqlTableModel::select()is called, which rebuilds the model cache with with new values from the db. This implies re-sorting.The fix:
Based on the assumption that metadata of the tracks remaning after purge/hide is unchanged, we don't need to call
select()-- we can simply remove the obsolete rows.This does however not apply to Playlists where removing tracks changes the 'position' value of the others. There we still
select()for now.Note: so far I only tested with Tracks.
Also test with the Crates and Hidden views.