refactor(research): simplify ID extraction and normalization logic
This commit refines the extraction and normalization processes for track and artist IDs across various functions. The extractProviderTrackId and resolveArtist functions have been updated to exclusively use a single provider-neutral id, removing legacy fields. Additionally, normalization functions for artist and track records have been adjusted to omit SongStats-specific ID aliases, streamlining the data structure. Tests have been updated accordingly to ensure consistent behavior.
Summary by cubic
Unify research IDs to a single provider‑neutral id for tracks, artists, and albums, removing SongStats alias fields from normalized payloads and catalog results. Adds album normalization and cleans up get‑ids and catalog mapping to keep outputs consistent across endpoints.
-
Refactors
- Apply provider‑neutral
ideverywhere; strip alias keys viaproviderIdAliasesinnormalizeArtistRecord,normalizeTrackRecord,normalizeAlbumRecord,normalizeTrackObject(delegates), andnormalizeTrackLookupObject. extractProviderTrackIdandresolveArtistreadidonly.mapSongstatsArtistPathnormalizes albums withnormalizeAlbumsCatalogItemand tracks withnormalizeTrackRecord.
- Apply provider‑neutral
-
Migration
- Replace any use of
songstats_artist_id,artist_id,songstats_track_id,track_id,songstats_track_ids,songstats_album_id, andalbum_idwithid. - For get‑ids responses, expect a single
idinstead ofsongstats_track_ids.
- Replace any use of
Summary by CodeRabbit
- Refactors
- Enhanced consistency in research data normalization by standardizing how identifiers are handled across tracks, artists, and albums.