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-65 | Move scrobble queries out of Records context | Done | 2026-04-20 08:55 |
|
medium |
Description
GitHub: created 2026-03-12 · updated 2026-03-12 · closed 2026-03-12
Problem
MusicLibrary.Records directly queries LastFm.Track in three places: get_last_listened_track/1, play_count/1, scrobbles_for_record_query/1. This is a cross-domain leak — scrobble data belongs to the listening/stats domain.
Proposed solution
Move get_last_listened_track/1 and play_count/1 into MusicLibrary.ListeningStats. Update LiveView callers (CollectionLive.Show, WishlistLive.Show) to call ListeningStats instead of Records. Remove LastFm.Track alias from Records.
Files involved
lib/music_library/records.exlib/music_library/listening_stats.exlib/music_library_web/live/collection_live/show.exlib/music_library_web/live/wishlist_live/show.ex- Tests for the above