fix: use iTunes lookup endpoint for explicit artist tracks
iTunes search endpoint always returns cleaned versions. Added itunesLookupArtistSongs() using /lookup?explicit=Yes which returns the actual explicit tracks. Used in artist profile (global search) and artist detail page (library). Album track lookup also gets explicit=Yes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
fc951d103b
commit
3c5048f017
2 files changed
+16
-5
No files matched your search
+8
-1
@@ -43,7 +43,14 @@ export async function itunesSearch(query, entity='musicTrack', limit=25) {
|
||||
}
|
||||
|
||||
export async function itunesLookupAlbum(collectionId) {
|
||||
const r = await fetch(`${ITUNES}/lookup?id=${collectionId}&entity=song`);
|
||||
const r = await fetch(`${ITUNES}/lookup?id=${collectionId}&entity=song&explicit=Yes`);
|
||||
const d = await r.json();
|
||||
return (d.results || []).filter(x => x.wrapperType === 'track');
|
||||
}
|
||||
|
||||
// Returns actual explicit tracks for an artist via lookup (search endpoint only returns cleaned versions)
|
||||
export async function itunesLookupArtistSongs(artistId, limit=15) {
|
||||
const r = await fetch(`${ITUNES}/lookup?id=${artistId}&entity=song&limit=${limit}&country=us&explicit=Yes`);
|
||||
const d = await r.json();
|
||||
return (d.results || []).filter(x => x.wrapperType === 'track');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user