chronicle
chronicle copied to clipboard
Handling numbers in titles when sorting
In the library view, books ought to be sorted like the following (numbers sorted by number order):
- Series Name - Book 1 - Title
- Series Name - Book 2 - Title
- Series Name - Book 3 - Title
...
- Series Name - Book 10 - Title
- Series Name - Book 11 - Title
They are currently sorted like so:
- Series Name - Book 1 - Title
- Series Name - Book 10 - Title
- Series Name - Book 11 - Title
...
- Series Name - Book 19 - Title
- Series Name - Book 2 - Title
- Series Name - Book 20 - Title
- Series Name - Book 21 - Title
This can be remedied by sorting by "natural order" instead of of by default string order. Natural sort in kotlin:
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.comparisons/natural-order.html
As of writing this ticket, sorting currently happens in LibraryViewModel
Original report on the reddit: https://www.reddit.com/r/ChronicleApp/comments/rgahts/not_properly_sorting_books_by_title/