Bugzilla – Bug 2563
Incorrect sorting of alphanumeric characters in album display
Last modified: 2007-10-16 09:29:09 UTC
If one is browsing one's collection of albums, then titles that are combinations of numbers and letters are sometimes not correctly ordered. For example, a collection of albums, each labelled 'Piano Sonata X', X = 1 to 32, gets sorted: Piano Sonata 1 - Brendel Piano Sonata 10 - Brendel Piano Sonata 11 - Brendel Piano Sonata 12 - Brendel Piano Sonata 13 - Brendel Piano Sonata 14 - Brendel Piano Sonata 15 - Brendel Piano Sonata 16 - Brendel Piano Sonata 17 - Brendel Piano Sonata 18 - Brendel Piano Sonata 19 - Brendel Piano Sonata 2 - Brendel Piano Sonata 20 - Brendel Piano Sonata 21 (Waldstein) - Brendel . . . Notably, iTunes sorts the albums correctly, i.e. #1, #2, #3, #4, ..., #32 in its display. It would be nice if SlimServer could do the same. (using SlimServer Version: 6.2.0 - 4753 - Mac OS X 10.4.3 (8F46) - EN - utf8)
I found a tweak to adjust a sorting problem in bug 2583, which may also solve this issue. Have left it for Dan to evaluate since I'm not fluent with the datastore side of things.
please try Nov 19 build of 6.2.2 and let us know if that works.
(In reply to comment #2) > please try Nov 19 build of 6.2.2 and let us know if that works. > I've downloaded the build from the Nightly for Mac OS X for SlimServer 6.2.2 from: http://www.slimdevices.com/downloads/nightly/latest/6.2.2/SlimServer_6_2_x_v2005-11-19.dmg But either it is not the build suggested, or there is no change in behaviour. (The nightly has SlimServer Version: 6.2.1 - 5252 - Mac OS X 10.4.3 (8F46) - EN - utf8 as the version information, which doesn't seem right.)
try using 01, and 02 instead of 1 and 2. just a workaround for now.
This isn't fixable until 6.5 when we move to MySQL. We need to either use: ORDER BY SOUNDEX(title); or: ORDER BY title + 0; in order to force a numeric comparison on a alphanumeric column.
Fixed in change 7955 for 6.5
the fix appears to have broken the sort for me. I'm seeing albums listed by id, not title. Also, unicode pagebar items are also broken. reverting change 7955 corrects the break.
Really fixed in change 7983
This still isn't fixed for me in 6.5.0. I get the following listing of album titles: Piano Sonata - Brendel - #1 Piano Sonata - Brendel - #10 Piano Sonata - Brendel - #11 (Grande Sonata) Piano Sonata - Brendel - #12 (Trauermarsch) Piano Sonata - Brendel - #13 Piano Sonata - Brendel - #14 (Moonlight) Piano Sonata - Brendel - #15 (Pastorale) Piano Sonata - Brendel - #16 Piano Sonata - Brendel - #17 (The Tempest) Piano Sonata - Brendel - #18 Piano Sonata - Brendel - #19 Piano Sonata - Brendel - #2 Piano Sonata - Brendel - #20 Piano Sonata - Brendel - #21 (Waldstein) ... and a similar kind of listing any or numbered thing >9. Any chance this could be fixed?
A work around is to prefix with 0s
Your other work around is to use the album sort tag, and just put the numbers in there.
Apparently this type of ordering is referred to as a "natural sort". The + 0 thing only works if the entries are all numeric, as any alpha characters and varying length strings will throw it off. Is the following of any help? http://search.cpan.org/~salva/Sort-Key/lib/Sort/Key/Natural.pm Seems to me that if you're not using a MySQL index for sorting, then using something like this could exact a pretty big performance penalty. Maybe just use it for album track lists?
This isn't going to be fixed for 6.5.1 or perhaps at all. Please use the ALBUMSORT tag.
That's a shame---especially since iTunes sorts it correctly. Could you explain how to do the workaround with the ALBUMSORT tag?
Im sorry, but we're not iTunes. If you're using MP3s, set the TSOA (Album Sort) tag. It would be something like this, for each of the tracks in that 'album'. Piano Sonata - Brendel - 01 Piano Sonata - Brendel - 10 Piano Sonata - Brendel - 11 Piano Sonata - Brendel - 12 Removing the parens with additional information, and adding a leading 0 to single digit numbers.
Thanks---that's a pity. I'm not using MP3s, so I can't use it. The other workaround of putting zeros in front of the numbers just looks odd for Beethoven piano sonatas. I'll just have to live with the incorrect ordering.
What format are you using? They all have something similar. FLAC or Ogg or Apple Lossless have a ALBUMSORT tag.
I'm using Apple Lossless---is there an easy way to access the album sort tag?
if it's apple lossless, I would expect your only option is whatever iTunes provides.
It doesn't look like I can do anything with the albumsort tag then... I'll live with the behaviour.