1.1 KiB
1.1 KiB
id, title, status, assignee, created_date, labels, dependencies, references, priority
| id | title | status | assignee | created_date | labels | dependencies | references | priority | |
|---|---|---|---|---|---|---|---|---|---|
| ML-62 | Route Search artist queries through Artists context | Done | 2026-04-20 08:54 |
|
low |
Description
GitHub: created 2026-03-12 · updated 2026-03-12 · closed 2026-03-12
Problem
MusicLibrary.Search.search_artists/2 and search_artists_count/1 build their own Ecto queries directly joining Records.ArtistRecord to Artists.ArtistInfo, bypassing the Artists context entirely. This violates the project convention that context modules own all queries.
Proposed solution
Add search_by_name/2 and search_by_name_count/1 to MusicLibrary.Artists, then have Search.search_artists/2 and Search.search_artists_count/1 delegate to them. Remove ArtistRecord and ArtistInfo aliases from Search.
Files involved
lib/music_library/artists.ex(add functions)lib/music_library/search.ex(delegate, remove aliases)- Tests for
ArtistsandSearch