Repository navigation
feat: add GET /library/albums and /library/artists - #405
Conversation
6285332 to
f4821e8
Compare
ba45010 to
c543fdc
Compare
c543fdc to
51db3e7
Compare
|
Is the cache really needed? It adds a bunch of complexity |
List the albums saved in the user's library and the artists the user follows, most recent first. The lists come from the collection service (saved albums share the "collection" set with Liked Songs, followed artists are the "artist" set) and names, years and images from batched extended metadata, so neither goes through the rate-limited Web API. Like /library/playlists, every request reads the list and pages it in memory; only the requested page's entities are looked up. The sets are read with the new Spclient.CollectionPage, which pages through a collection set (PageRequest/PageResponse). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No, it isn't. I added it because the collection service only pages by token, and saved albums share the "collection" set with Liked Songs, so every page meant re-reading the whole set and looking up every album. Looking up only the requested page fixes most of that, and on a real library (98 saved albums in a set of ~1200 items, 39 followed artists) a request now takes 0.1–0.3 s. So I removed it: every request now reads the set and pages it in memory like |
51db3e7 to
d670a72
Compare
|
BTW your git setup is broken in such a way it does not mark you as a contributor |
Adds
GET /library/albumsandGET /library/artists, listing the albums saved in the user's library and the artists they follow, most recent first, so a client can browse the whole library through the daemon:collectionset with Liked Songs, followed artists are theartistset.ALBUM_V4/ARTIST_V4), with image URLs built likealbum_cover_url(honouringimage_size). Entries whose metadata does not resolve are still listed by URI.offset/limitlike/library/playlists; the paging validation is now shared by the three listings./context/tracksand/player/play.Testing
go mod tidy,go generate ./...,gofmt, build andgo test -tags "test_unit test_integration" ./...are clean.🤖 Generated with Claude Code