question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't get some things like "GetUsersTopArtists" to work

See original GitHub issue

Hi, I have problems with some of the functions that I want to use. Some things like GetPrivateProfile and GetUserPlaylists works good but others like GetUsersTopArtists and GetDevices gives me this error:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at SpotifyTesting.Program.PrintUsefulData(SpotifyWebAPI api) in /home/jesper/CSpoTUI/Program.cs:line 108 at SpotifyTesting.Program.<>c__DisplayClass3_0.<<Main>b__0>d.MoveNext() in /home/jesper/CSpoTUI/Program.cs:line 40 --- End of stack trace from previous location where exception was thrown --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_1(Object state) at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

I am using code examples from the docs like this one.

Paging<FullTrack> tracks = api.GetUsersTopTracks(); tracks.Items.ForEach(item => Console.WriteLine(item.Name)); //Display all fetched Track-Names (max 20) Console.WriteLine(tracks.Total.ToString());//Display total album track count

I’m also using AutorizationCodeAuth. There is probably something simple but I can’t figure out why some functions don’t work.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
20repsejcommented, Apr 21, 2020

Thank you very mush. I think that solves my problems so i close this issue now.

0reactions
JohnnyCrazycommented, Apr 21, 2020

Not possible, you will have to join every value of https://github.com/JohnnyCrazy/SpotifyAPI-NET/blob/e9685ff4c318f23d9062311f6b03653bc43a3b09/SpotifyAPI.Web/Enums/Scope.cs

Example: Scope.PlaylistModifyPublic | Scope.PlaylistModifyPrivate

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to get user's top artists and tracks with Spotify API
This is in a componentDidMount method in my React app. Any ideas, other approaches I should be taking to getting this to work...
Read more >
Getting Other Users' Top Artists/Top Tracks
It is possible to access the top tracks/artists of another user? I know authorization is required but how would that work for a...
Read more >
Your top artists and tracks : r/spotify
Hi all. I just want to remind everybody that I've got a little web app that will tell you your top artists and...
Read more >
Generating personalized music playlists based on desired ...
The findings showed that young people knew which music to play in different contexts in order to get into desired mood, achieve a...
Read more >
https://raw.githubusercontent.com/APIs-guru/openap...
Use this parameter to specify the user's local time to get results tailored for that specific date and time in the day. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found