Repository navigation
Commit 407e13b
feat(fetcher): add lastfm_top_tracks
Sibling of `lastfm_top_artists`: a user's top tracks for a rolling
window via `user.getTopTracks`. Same option contract (`user` / `period`
/ `limit`) and same 10 shapes via the shared `lastfm/top.rs` surface.
Difference from `top_artists` lives in the row mapping: the API nests
the artist as a proper `{"name": "..."}` object (rather than the
`{"#text": "..."}` form `user.getRecentTracks` uses), so each row's
secondary label populates from `artist.name`. Empty strings collapse to
`None` so a malformed response renders the track without a stray
trailing dash.
Rendering helpers receive `secondary = Some(artist)` and emit
`"Track — Artist"` titles automatically — no per-sibling rewrite of
the row format.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent 9d8dd2b commit 407e13b
2 files changed
Lines changed: 451 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
0 commit comments