-
Notifications
You must be signed in to change notification settings - Fork 1
feat(library): browse both sources from one track list #552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
38 changes: 38 additions & 0 deletions
38
src-tauri/migrations/profile/20260826180000_remote_track_sort_keys.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| -- Sort keys for the mirrored tracks, for the same reason the albums have them. | ||
| -- | ||
| -- The unified track listing sorts both halves against each other, and the | ||
| -- local half sorts artist and album on `artist.canonical_name` / | ||
| -- `album.canonical_title` — forms produced by | ||
| -- `waveflow_core::metadata::name_match::normalize_name`, which lowercases, | ||
| -- folds diacritics and drops punctuation. SQLite reproduces none of that, so | ||
| -- a remote half sorted on its raw display strings interleaves wrongly and | ||
| -- splits an artist in two down the middle of the list. | ||
| -- | ||
| -- Only artist and album. The title has no canonical form on the local side | ||
| -- either — it sorts on `track.title COLLATE NOCASE` — so both halves sort the | ||
| -- title on their display string, which keeps that column consistent by using | ||
| -- the same expression rather than by normalising one side only. | ||
| -- | ||
| -- Filled by `projection::cache_song`, the single place a remote track row is | ||
| -- written: from the snapshot, from a change event, from a search hit and from | ||
| -- the catalogue walk alike. Nullable because rows cached before this migration | ||
| -- have none; the listing falls back to the display string, and any later | ||
| -- sighting of the track fills them in. | ||
| ALTER TABLE remote_track ADD COLUMN sort_artist TEXT; | ||
| ALTER TABLE remote_track ADD COLUMN sort_album TEXT; | ||
|
|
||
| CREATE INDEX idx_remote_track_sort ON remote_track (sort_artist, sort_album, title); | ||
|
|
||
| -- Existing rows have no keys, and nothing would ever give them any. | ||
| -- | ||
| -- The columns are nullable and the listing coalesces to the display string, | ||
| -- so an un-keyed row still renders — but it sorts on the wrong expression, | ||
| -- which is the whole defect these columns exist to fix. And it would sort that | ||
| -- way *forever*: the walk skips an album whose `song_count` is unchanged, so | ||
| -- `cache_song` never runs again for its tracks and the keys stay NULL. | ||
| -- | ||
| -- SQLite cannot compute them (it cannot fold a diacritic), so the stamps are | ||
| -- cleared instead: every album becomes stale, the next walk re-fetches it, and | ||
| -- `cache_song` fills the keys on the way through. One walk, and it is | ||
| -- incremental again afterwards. | ||
| UPDATE remote_album SET mirrored_at = NULL; | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.