Enhance mapSongstatsArtistPath to utilize new queries for artist albums and top tracks.
AH
6mo ago+659+659+012345678901234567890123456789-8-8-0123456789
Update tests to verify correct mapping of artist albums and tracks to respective endpoints, ensuring proper data retrieval and normalization.
Summary by cubic
Switch artist albums and tracks to SongStats’ dedicated endpoints with safer defaults, cleaner filtering, and safe query passthrough. Albums default to primary-only; tracks use top tracks with a primary-catalog fallback.
-
New Features
- Map
/artist/:id/albumsto/artists/catalogviabuildArtistCatalogQuery; defaultis_primary=true(acceptsis_primary/isPrimary, empty treated as true), respectlimit/offset, normalize items withid. - Map
/artist/:id/tracksto/artists/top_tracksviabuildArtistTopTracksQuery; defaultsource=spotify,metric=popularity, flatten and filter noise; fall back to a filtered primary catalog slice viafetchArtistTracksFromSongstats(default limit 50). - Forward
limit,offset,source, andmetricto tracks throughgetResearchTracksHandler.
- Map
-
Refactors
- Use
resolveCatalogPrimaryandappendPassthroughQueryParams; block artist ID overrides; updatemapSongstatsArtistPathto call new helpers; simplifybuildArtistTopTracksQueryby removing unused params. - Improve normalization:
normalizeArtistAlbumsdrops non-object rows and filters noisy/secondary items when primary-only;shouldIncludeCatalogItemexcludes entries without a title/track ID, remix/feature flags, or secondary roles with clearer inclusion logic.
- Use
Summary by CodeRabbit
Release Notes
- New Features
- Enhanced artist discography browsing with improved album and track catalog retrieval.
- Added filtering capabilities to exclude noisy or secondary catalog entries (remixes, features, non-primary releases).
- Implemented primary vs. non-primary release filtering for more relevant artist results.