Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseSqlTableModel: Fix bounds check #11499

Merged
merged 1 commit into from
May 3, 2023
Merged

Conversation

fwcd
Copy link
Member

@fwcd fwcd commented Apr 19, 2023

This fixes #11491, i.e. fixes the sorting for certain columns (e.g. BPM).

I hope this solution is also semantically correct, since I don't have a super deep understanding of the different indexing schemes (sort columns vs column indices etc.).

From what I understand, the issue was that the table columns (track_id, position, preview) weren't considered and then caused the bound check to fail. This was particularly an issue for columns such as BPM and rating since they have a rather high index and thus fell outside the range of the 3 track table columns that weren't considered:

Screenshot 2023-04-19 at 17 08 59

Once m_sortColumns was populated (which happens on the first sort), the bound check 'accidentally' passed since the previously out-of-bounds column indices were suddenly in bounds. This is also why sorting by a key such as title or artist would 'fix' the BPM sorting issue.

This should hopefully resolve the issue both for iTunes and Traktor (and perhaps other external) playlists.

@fwcd
Copy link
Member Author

fwcd commented Apr 19, 2023

Since this fixes a pretty central bug while being a rather isolated change, perhaps it would even be worth targeting 2.3? Or are there no more 2.3 releases planned?

@daschuer
Copy link
Member

We have planned a 2.3.5 see the milestone.
It sounds that this suits to it.

@fwcd fwcd force-pushed the fix-sql-table-sort branch from 8e5ec72 to c0ff440 Compare April 19, 2023 16:40
@fwcd fwcd changed the base branch from 2.4 to 2.3 April 19, 2023 16:40
@fwcd
Copy link
Member Author

fwcd commented Apr 19, 2023

I've rebased it on 2.3

@fwcd
Copy link
Member Author

fwcd commented Apr 28, 2023

@daschuer Any chance you could take a quick look at this? It solves the small, but annoying bug of BPM sorting being broken in iTunes libraries

@daschuer daschuer added this to the 2.3.5 milestone Apr 28, 2023
@daschuer daschuer added the bug label Apr 28, 2023
Co-authored-by: Daniel Schürmann <daschuer@mixxx.org>
@fwcd fwcd force-pushed the fix-sql-table-sort branch from c0ff440 to f2766ad Compare May 1, 2023 00:38
@fwcd
Copy link
Member Author

fwcd commented May 1, 2023

Thanks for clarifying, I've updated the branch with your suggested fix. Would be awesome if this could be included in 2.3.5

@daschuer
Copy link
Member

daschuer commented May 3, 2023

Thank you.

@daschuer daschuer merged commit e00ffc5 into mixxxdj:2.3 May 3, 2023
@fwcd fwcd deleted the fix-sql-table-sort branch May 3, 2023 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants