1.7 KiB
1.7 KiB
id, title, status, assignee, created_date, labels, dependencies, references, priority
| id | title | status | assignee | created_date | labels | dependencies | references | priority | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ML-150 | Extract Records sub-contexts to reduce module size | To Do | 2026-04-30 10:47 |
|
|
medium |
Description
The Records context module (450+ lines in lib/music_library/records.ex) handles CRUD, FTS5 search, MusicBrainz import, cover management, genre population, color extraction, PubSub notifications, and similarity embedding dispatch — too many responsibilities for a single module.
Extract focused sub-contexts:
Records.Search— FTS5 search,SearchParserintegration, search result formattingRecords.Import— MusicBrainz release/group import, barcode scan integrationRecords.Enrichment— genre population, color extraction, cover management, embedding dispatch
Keep the public Records module as a facade that re-exports key functions for backward compatibility with all existing callers (LiveViews, workers, controllers).
The SearchIndex schema, Record schema, Similarity module, TracklistPdf, and Batch sub-modules stay as-is. Only records.ex itself is being split.
Acceptance Criteria
- #1
Records.Search,Records.Import, andRecords.Enrichmentmodules exist with focused responsibilities - #2 Public
Recordsmodule re-exports all previously-public functions through delegation - #3 All callers (LiveViews, workers, controllers, tests) continue to work without changes to their import/alias lines
- #4 Full test suite passes with no regressions
- #5
@moduledocfor each new module explains its responsibility