1

Hey guys I am currently working with the Spotify SDK. I implemented a Login and asking for permission to access the Users Playlist.

When the user gives me the permission I can access all their tracks and get all kinds of information out of them, but for some reason the genre seems to be empty most of the time. Is this just because Spotify tends to not give many artists genres or is this just hidden away somewhere, and I'm just not looking in the right place? So far I've checked the genres property in the album object and the one in the artist object.

Stav
  • 11
  • 3

1 Answers1

1

I'am having the same issue. I was searching through my own music library, and got 243 empty out of 312 musics, some musics have more than one artist so it was 243 out of 453 in total.

I did some research before that and got the info that to get the music genres I was supposed to get it from the artist, but it seems that spotify doesn't care that much with the artists genres empty.

Here is how I managed to get the artists genres:

SPTArtist.artistWithURI(artistUri, accessToken: self.auth.session.accessToken) { error, result in

guard error == nil else {
    let alert = UIAlertController(title: "Error", message: error!.localizedDescription, preferredStyle: .Alert)
    self.presentViewController(alert, animated: true, completion: nil)
    return
}                               
print("music genres by artist: \(result.genres)")

}