Closed mjdierkes closed 2 years ago
Hi there!
Thank you for appreciating MusadoraKit!
I am not sure there is any functionality like that in the Apple Music API.
However, you can get a chart for a particular genre that contains the most played songs:
var request = MusicCatalogChartRequest(types: [Song.self])
request.genre = "34"
let response = try await request.response()
print(response.songs)
Let me know what you think!
Awesome! That works great!
Do you have a way to easily get all the available genres?
Never mind, your blog helped out :) https://rudrank.blog/exploring-musickit-genres
Just want to bump up this issue again, MusadoraKit does not have the capability to fetch all the genres, right? @mjdierkes
In iOS 16, they have a new initializer for MusicCatalogResourceRequest
for fetching the genres but they forgot to confirm the protocol MusicCatalogTopLevelResourceRequesting
to Genre
in the first beta.
To fetch the genres, all you will have to do is:
let request = MusicCatalogResourceRequest<Genre>()
let response = try await request.response()
print(response) // <-- MusicItemCollection<Genre>
Don't want to annoy you, but now you can get the catalog top chart genres simply by:
print(try await MusadoraKit.catalogTopChartsGenres())
Let me know what you think!
Hi Rudrank,
Great Package! Is it possible to search for songs by their Genre ID? I haven't been able to find anything regarding Genre search yet.