rryam/MusadoraKit

How does MusicKit love/unlove a song?

Kejiasir opened this issue · 2 comments

Hi, how does MusicKit love/unlove a song? Do you know of any related APIs?

20220630191558

Heya! MusicKit does not have a rating API as of yet.

However, you can use MusadoraKit for this purpose. For example, to add a Love rating for a particular song, you can do so by:

let id: MusicItemID = "1628890886"
let request = MusicCatalogRatingAddRequest<Song>(matching: \.id, equalTo: id, rating: .loved)
let response = try await request.response()

print(response.items)

If it is a success, you will get the rating that contains the identifier of the music item, and the rating.

Let me know if you use it!

wow, awesome, this helped me, thank you.