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

Library sorts track numbers as strings #5425

Closed
mixxxbot opened this issue Aug 22, 2022 · 8 comments
Closed

Library sorts track numbers as strings #5425

mixxxbot opened this issue Aug 22, 2022 · 8 comments
Labels

Comments

@mixxxbot
Copy link
Collaborator

Reported by: bkgood
Date: 2010-06-19T19:36:05Z
Status: Fix Released
Importance: Low
Launchpad Issue: lp596345
Tags: number, sort, track
Attachments: [Screenshot of bug](https://bugs.launchpad.net/bugs/596345/+attachment/1430875/+files/Screenshot of bug), tracksort.patch


The library sorts track numbers as "1 10 2 3 4 5 ... 9" instead of "1 2 3 4 ... 9 10", because sqlite is being told to order the result set by the raw "tracknumber" column, which is stored as a string (presumably to accommodate formats which store track numbers like "1/10" for the first of a ten-number album).

See attached screenshot for example.

@mixxxbot
Copy link
Collaborator Author

Commented by: bkgood
Date: 2010-06-19T19:36:05Z
Attachments: [Screenshot of bug](https://bugs.launchpad.net/mixxx/+bug/596345/+attachment/1430875/+files/Screenshot of bug)

@mixxxbot mixxxbot added the bug label Aug 22, 2022
@mixxxbot
Copy link
Collaborator Author

Commented by: bkgood
Date: 2010-06-19T19:45:44Z
Attachments: tracksort.patch


Oi, should mention this affects trunk.

Attached patch is one possible solution, telling sqlite to sort the column as a number. In the case it can't find a number (i.e. if the first non-whilespace character is non-numeric), sqlite regards it to be 0 for the purposes of sorting (see http://www.sqlite.org/lang_expr.html ). If a string such as "1/10" is stored, it will be sorted as "1".

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2010-06-19T20:12:11Z


Committed, thanks!

@mixxxbot
Copy link
Collaborator Author

Commented by: deftdawg
Date: 2010-06-19T20:27:34Z


ooh you guys fixed this already... That was fast!

I was going to say there was some proxymodel sorting logic to handle BPMs, blank title / artist columns and stuff like that @
http://bazaar.launchpad.net/~mixxxdevelopers/mixxx/release-1.6.2/annotate/head:/mixxx/src/proxymodel.cpp#L29

I suspect what you guys will probably cleaner then overriding the LessThan operator though.

Cheers,

-G

@mixxxbot
Copy link
Collaborator Author

Commented by: rryan
Date: 2010-06-19T20:44:27Z


Yea we don't sort in memory anymore, thank god :).

On Sat, Jun 19, 2010 at 1:27 PM, ironstorm wrote:

ooh you guys fixed this already... That was fast!

I was going to say there was some proxymodel sorting logic to handle BPMs,
blank title / artist columns and stuff like that @

http://bazaar.launchpad.net/~mixxxdevelopers/mixxx/release-1.6.2/annotate/head:/mixxx/src/proxymodel.cpp#L29

I suspect what you guys will probably cleaner then overriding the
LessThan operator though.

Cheers,

-G

--
Library sorts track numbers as strings
https://bugs.launchpad.net/bugs/596345
You received this bug notification because you are subscribed to Mixxx.

@mixxxbot
Copy link
Collaborator Author

Commented by: spiral6
Date: 2015-03-31T22:33:32Z


As of Mixxx 1.10 this is broken again.

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2015-04-01T05:53:17Z


Mixxx 1.10 falls out of support. please upgrade to 1.11

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant