Repository navigation
Commit 9d8dd2b
feat(fetcher): add lastfm_top_artists
First consumer of the shared `lastfm/top.rs` rendering surface: a user's
top artists for a rolling window via `user.getTopArtists`.
Options: required `user`, optional `period` (default `"7day"`, also
`"1month"` / `"3month"` / `"6month"` / `"12month"` / `"overall"`),
optional `limit` (1..=50, default 10).
Shapes (10): LinkedTextBlock (default) / ImageLinkedList / TextBlock /
Text / MarkdownTextBlock / Entries / Ratio (top artist's share of the
window total, denominator carrying the sum) / NumberSeries (playcounts
as a sparkline) / Bars / Badge.
Rank prefers Last.fm's own `@attr.rank` when present, falling back to
the 1-indexed position so a malformed response still renders rather
than disappearing. Playcounts that don't parse collapse to zero
(`parse_count` shared from `common`).
Cache key partitions on period + shape so switching `"7day"` to
`"1month"` doesn't serve a stale snapshot.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>1 parent db5bacc commit 9d8dd2b
2 files changed
Lines changed: 468 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
22 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
| 43 | + | |
39 | 44 | | |
40 | 45 | | |
0 commit comments