1.5 KiB
1.5 KiB
id, title, status, assignee, created_date, labels, dependencies, references, priority
| id | title | status | assignee | created_date | labels | dependencies | references | priority | |
|---|---|---|---|---|---|---|---|---|---|
| ML-28 | Records context has 8+ responsibilities | To Do | 2026-04-20 08:51 |
|
medium |
Description
GitHub: created 2026-04-05 · updated 2026-04-11 · closed 2026-04-11 · not planned
Summary
The Records context module handles search, genre management, cover art operations, color extraction, embeddings, MusicBrainz data refresh, artist metadata refresh, CRUD, and PubSub notifications — too many concerns in one module.
Why This Matters
- Hard to navigate and understand at a glance
- Changes to one concern risk affecting others
- Testing is harder when responsibilities are interleaved
Affected Files
lib/music_library/records.ex
Suggested Fix
Extract into focused sub-modules:
Records.Search— search operationsRecords.Metadata— MusicBrainz sync, genre populationRecords.Assets— covers, colorsRecords.Embeddings— AI embedding generation
Keep the Records module as the public API that delegates to sub-modules.
Acceptance Criteria
- Each sub-module has a single clear responsibility
- Public API remains unchanged for callers
- No regression in functionality
- #1 Each sub-module has a single clear responsibility
- #2 Public API remains unchanged for callers
- #3 No regression in functionality