Hi there!
I was experimenting with the MusicCatalogChartsRequest. I have one doubt, and I do not know if it is the intended behavior.
If I have the kinds as [.cityTop]
and the types as [Song.self]
, why does it print the city playlists and the top played playlists?
Ideally, it should print an empty array, right? As I have only Song
as a type?
var request = MusicCatalogChartsRequest(kinds: [.cityTop], types: [Song.self]) request.limit = 1 let response = try await request.response() print(response.playlistCharts)
The output is:
[MusicCatalogChart<Playlist>( id: "city-top:cityCharts", kind: .cityTop, title: "City Charts", items: [ Playlist( id: "pl.db537759ae3341eaa600bc5482209f7c", name: "Top 25: Mumbai", curatorName: "Apple Music", isChart: true, kind: "editorial", lastModifiedDate: "2022-06-21", url: "https://music.apple.com/in/playlist/top-25-mumbai/pl.db537759ae3341eaa600bc5482209f7c" ) ], hasNextBatch: true ), MusicCatalogChart<Playlist>( id: "most-played:playlists", kind: .mostPlayed, title: "Top Playlists", items: [ Playlist( id: "pl.f4d106fed2bd41149aaacabb233eb5eb", name: "Today’s Hits", curatorName: "Apple Music Hits", isChart: false, kind: "editorial", lastModifiedDate: "2022-06-21", shortDescription: "Drake gets loose with “Sticky”.", standardDescription: "Among the many surprises of Drake’s <i>Honestly, Nevermind</i>—not the least of which is the album’s very existence—is that it isn’t really a hip-hop album at all; he’s mainly singing. But “Sticky” is one of the few tracks where the project’s commitment to exploring dance music—courtesy here of production work from Australian artist RY X and Gordo (aka DJ Carnage)—meets actual rapping. Add Today’s Hits to your library to stay up on the biggest songs in pop, hip-hop, R&B and more.", url: "https://music.apple.com/in/playlist/todays-hits/pl.f4d106fed2bd41149aaacabb233eb5eb" ) ], hasNextBatch: true )]
Thank you!
Oh I see. Fair enough. I just forgot about that small implementation detail.
Yes, I suppose our current client-side implementation does diverge from Apple Music API in that regard.
I think you should file a ticket on Feedback Assistant about this. We can probably improve this area of the MusicCatalogChartsRequest.
Thank you very much in advance.
Best regards,