Sort the library ignoring case and accents - #17
Merged
Merged
Conversation
The library ordered names by their bytes, as SQLite does, so "abba" came after "ZZ Top", and "Émile" after both. The database now has a LOCALIZED collation that orders text as the phone's language does, as search results are, and the library's levels are ordered with it. It's named as the one Android's SQLite has, so both clients use the same SQL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012foWs5vBJrYTDtfyFhJ3ky
hatstand
enabled auto-merge (rebase)
September 30, 2026 09:53
The library test expected "Apple" before "apple", but the order of names differing only in case is the language's to choose, and on iOS it isn't that one. It now checks they're side by side, before the rest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012foWs5vBJrYTDtfyFhJ3ky
hatstand
disabled auto-merge
September 30, 2026 09:55
localizedStandardCompare told names differing only in case apart in its own order, not Android's. The LOCALIZED collation now compares ignoring case only, and the library then orders equal names by their bytes, as the Android client does, so "Apple" always comes before "apple". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012foWs5vBJrYTDtfyFhJ3ky
ScreenshotsFrom run 36699370934, against a real Clementine. Left: main. Right: this pull request, light and dark.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

































The library ordered names the way SQLite does by default, by their bytes, so "abba" came after "ZZ Top", and "Émile" after both.
Databasenow registers aLOCALIZEDcollation on every connection it opens. It compares withlocalizedStandardCompare, which iOS search results already use. Names that differ only in case get a fixed order between them, so the list is always in the same order.SongQueryorders each level with it:ORDER BY <field> COLLATE LOCALIZED, and for songsORDER BY album COLLATE LOCALIZED, disc, track, so an album's songs stay in track order.The collation is named after the one Android's SQLite has built in, so both clients run the same SQL. The Android change is clementine-player/Android-Remote#293.
I couldn't build this: my environment has no Swift toolchain. The new
sortsIgnoringCaseAndAccentstest checks the same cases as the Android test (artists both ways, albums, an album's songs), and thepackagejob in CI runs it withswift test.🤖 Generated with Claude Code
https://claude.ai/code/session_012foWs5vBJrYTDtfyFhJ3ky
Generated by Claude Code