Some Questions. #582
-
I'm using the NuGet package in my project. My project is to show what song is currently playing on Spotify as well as controlling it. 1: I'm trying to update the current track every second with requests to the Spotify API for the currently playing song. This uses a lot of API requests, but if I request for the current song at all, I get an error that my token is invalid. I've made users enter the token and set the spotifyclient when the program starts, so that can't be the case. 2: This still does relate to the current song question in 1, but I'm wondering how you can convert a CurrentSong to a FullTrack? I'm not exactly sure if I'm using the right package, but it seems as I can't use an explicit cast or a conversion of any kind. Maybe would using the "context.Href" of a currentsong work? Thank you for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Hi,
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. My current scopes are It looks like the currently playing item, in my case a variable called "cpr", does not have a property called "id". System.Reflection.TargetInvocationException This exception was originally thrown at this call stack: Inner Exception 1: My access token is correct as the user has to authorize with it every time the program starts. |
Beta Was this translation helpful? Give feedback.
-
Well you should then exchange it for an https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/authorization_code |
Beta Was this translation helpful? Give feedback.
-
Oh, sorry for misunderstanding. I thought an access token in a request was a code. Thanks. |
Beta Was this translation helpful? Give feedback.
Well you should then exchange it for an
access_token
. Thecode
can not be used as authorization.https://johnnycrazy.github.io/SpotifyAPI-NET/docs/next/authorization_code