Repository navigation
feat(library): sort artists and albums without their leading article - #838
Merged
Merged
Conversation
A NAME collation, FOLD on the name without a leading article (the, a, an, le, la, les, l, der, die, das, het, el, los, las, il, lo, gli), orders artist and album listings; track titles, genres and folders keep FOLD. Settings > Library toggles it (on by default, app_setting library.sort_ignore_articles), the A-Z rail files names under the same letter, and the library view refetches when it changes.
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.
What
Artist and album listings now set a leading article aside: "The Beatles" sorts under B, "Les Rita Mitsouko" under R, "L'Impératrice" under I. Settings → Library → "Ignore articles when sorting" turns it off (on by default, app-wide).
NAMEcollation incollation.rs, next toFOLD:FOLDon the name without its leading article, then on the full name, so "Kills" and "The Kills" keep a total order. Off, it isFOLD. It replacesFOLDonar.canonical_name,al.canonical_titleand thesort_artist/sort_album/sort_name/sort_titlealiases built from them. Track titles, genres and folders keepFOLD.the a an le la les l der die das het el los las il lo gli. Dutchdeis left out on purpose: it is as often a particle of a name ("De La Soul") as an article.canonical_name, which turns punctuation into spaces: "L'Impératrice" is storedl impératrice, so the elidedlis a word like the others. The known cost: "A-ha", storeda ha, files under H.set_sort_ignore_articlesafter the row is saved. No index uses the collation, so flipping it changes nothing stored.useSortIgnoreArticles(module store, published once the save lands, saves serialized) adds the flag toLibraryView's fetch signature so every tab refetches;AlphabetIndexfiles names withsortName.ts, the TypeScript copy ofstrip_article, applied to the same canonical key, so the rail and the list agree.Docs:
library.md, plus one line of RFC-005. 2 keys in all 17 locales.Testing
cargo clippy --workspace --all-targets -- -D warningscargo test -p waveflow-core --features sqlite: 10 collation tests, including a SQLite round-trip through the registered collation.bun run typecheck,bun run lintSummary by CodeRabbit