Library sorts track numbers as strings

Bug #596345 reported by William Good
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
William Good
Declined for 2.3 by RJ Skerry-Ryan
1.8
Fix Released
Low
William Good

Bug Description

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.

Tags: number sort track

Related branches

Revision history for this message
William Good (bkgood) wrote :
Revision history for this message
William Good (bkgood) wrote :

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".

RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: none → 1.8.0
status: New → Confirmed
Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Committed, thanks!

Changed in mixxx:
status: Confirmed → Fix Committed
assignee: nobody → Bill Good (bkgood)
importance: Undecided → Low
Revision history for this message
ironstorm (ironstorm-gmail) 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

Revision history for this message
RJ Skerry-Ryan (rryan) wrote : Re: [Bug 596345] Re: Library sorts track numbers as strings

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

On Sat, Jun 19, 2010 at 1:27 PM, ironstorm <email address hidden> 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.
>

Changed in mixxx:
milestone: 1.8.0 → none
RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Shamee Mahmud (spiral6) wrote :

As of Mixxx 1.10 this is broken again.

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Mixxx 1.10 falls out of support. please upgrade to 1.11

Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5425

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.