Library sorts track numbers as strings

Bug #596345 reported by Bill Good on 2010-06-19
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mixxx
Low
Bill Good
Declined for 2.3 by RJ Skerry-Ryan
1.8
Low
Bill 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.

Related branches

Bill Good (bkgood) wrote :
Bill 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) on 2010-06-19
Changed in mixxx:
milestone: none → 1.8.0
status: New → Confirmed
RJ Skerry-Ryan (rryan) wrote :

Committed, thanks!

Changed in mixxx:
status: Confirmed → Fix Committed
assignee: nobody → Bill Good (bkgood)
importance: Undecided → Low
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

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) on 2010-10-05
Changed in mixxx:
status: Fix Committed → Fix Released
Shamee Mahmud (spiral6) wrote :

As of Mixxx 1.10 this is broken again.

Daniel Schürmann (daschuer) wrote :

Mixxx 1.10 falls out of support. please upgrade to 1.11

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers