Skip to content

fix: sort artists case-insensitively with symbols before letters - #28

Merged
lstebner merged 1 commit into
mainfrom
fix/artist-list-case-insensitive-sort
Jul 9, 2026
Merged

fix: sort artists case-insensitively with symbols before letters#28
lstebner merged 1 commit into
mainfrom
fix/artist-list-case-insensitive-sort

Conversation

@lstebner

@lstebner lstebner commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Sidebar artist list (and album grid / track list ordering, which sort by the same key) was sorting A→Z→a→z→symbols instead of alphabetically, because SQLite's default ORDER BY on ar.name is a byte-wise comparison.
  • Adds a shared ARTIST_NAME_ORDER_BY SQL expression (db/queries/artists.rs) that applies NOCASE collation and groups any name starting with a digit/symbol before alphabetic names, and reuses it in albums.rs and tracks.rs so the artist ordering stays consistent everywhere it's used.

Test plan

  • cargo test --lib — 104 passed, including a new list_album_artists_sorts_case_insensitively_with_symbols_before_letters test covering mixed-case and symbol-prefixed names
  • Visual check of the sidebar artist list in a running build
Screencast.from.2026-07-08.20-35-33.mp4

🤖 Generated with Claude Code

SQLite's default ORDER BY uses byte-wise comparison, so all uppercase
names sorted before any lowercase one instead of interleaving them
alphabetically. Adds a shared ARTIST_NAME_ORDER_BY expression that
applies NOCASE collation and groups non-alphabetic leading characters
first, used consistently across the artist, album, and track queries.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@lstebner
lstebner enabled auto-merge (squash) July 9, 2026 03:37
@lstebner
lstebner merged commit 46446b7 into main Jul 9, 2026
2 checks passed
@lstebner
lstebner deleted the fix/artist-list-case-insensitive-sort branch July 9, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant