Skip to content

004 oss repo split#2

Merged
thooams merged 6 commits intomainfrom
004-oss-repo-split
Mar 1, 2026
Merged

004 oss repo split#2
thooams merged 6 commits intomainfrom
004-oss-repo-split

Conversation

@thooams
Copy link
Contributor

@thooams thooams commented Mar 1, 2026

No description provided.

Tornade CI and others added 6 commits February 27, 2026 11:11
Creates a new playlist from an M3U file (name from file stem),
matching tracks by file path against the library database.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously, artist detail view had no way to fetch albums by artist_id
directly — Swift was paginating the entire album catalog and filtering
client-side, which is both slow and incorrect for artists who only appear
as track artists (feat. / featuring).

Changes:
- queries::get_artist_albums: extend WHERE clause with OR EXISTS subquery
  so albums where the artist has at least one track are also returned,
  even if they are not the album artist (covers "Various Artists"-upgraded
  compilations and feat. artists)
- ffi.rs: expose get_artist_albums(artist_id) via swift-bridge so Swift
  can call it directly with a single FFI round-trip

A new test (test_get_artist_albums_includes_track_artist) verifies that
albums are found for artists who are track-only contributors.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously, albums without an ALBUMARTIST tag were matched by title only,
causing "Greatest Hits" by The Beatles and "Greatest Hits" by Eminem to
be merged into a single "Various Artists" album.

Album identity is now always (title, artist_id), matching the UNIQUE
constraint already present in the database schema. Each distinct
(title, primary_artist) pair produces its own album row.

Compilations with multiple track artists must be tagged with
ALBUMARTIST=Various Artists in the file metadata to be grouped correctly.

Removes: find_album_by_title (title-only lookup, no longer needed)
Keeps: update_album_artist (still useful for tagged-ALBUMARTIST path)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds clean_orphans() in queries.rs that:
- Deletes albums with no tracks
- Deletes artists with no tracks and no albums
Exposed via clean_library() FFI returning { albums_deleted, artists_deleted }.

Intended to be run after a rescan when the album-grouping fix may have
left behind stale "Various Artists" or other orphaned rows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes CI formatting check failures on all three platforms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thooams thooams merged commit 7b5b8ce into main Mar 1, 2026
6 checks passed
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