Skip to content

Better sorting with ICU4J transliteration #1110

@uku3lig

Description

@uku3lig

Currently, Auxio "naively" sorts names by doing string comparisons (or with the slightly more intelligent sort), which works well but has the side effect of putting at the end all names with special/foreign characters (eg. japanese, cyrillic, etc).

On the other hand, Jellyfin doesn't have such problem because it uses ICU4N's Transliterator to convert any name to an (easily sortable) ASCII counterpart.

Android provides a subset of ICU4J APIs under the android.icu, notably android.icu.text.Transliterator, which can be instantiated and used to convert names internally. The only caveat is that it's only available since Android 10 (API 29).

I have a half-working prototype on my fork which seemed promising (see attached screenshot), and if you think this feature could be a good addition to Auxio I would absolutely be down to contribute it myself :)

Screenshot of PoC

The middle album can be read/transliterated as "anchisaikron", which is correctly put between albums in the A letter by transliterating.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmusicRelated to music loading

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions