JohnnyCrazy / SpotifyAPI-NET

:sound: A Client for the Spotify Web API, written in C#/.NET
http://johnnycrazy.github.io/SpotifyAPI-NET/
MIT License
1.47k stars 297 forks source link

Possible incorrect type inference when fetching playlist tracks #967

Closed ArseniSkobelev closed 2 months ago

ArseniSkobelev commented 2 months ago

Hi! I may possibly be doing something wrong, but when trying to fetch the list of playlist tracks Playlist.GetItems(playlistId) I get less properties in the inferred types than the JSON serialized string. I am getting a Paging<PlaylistTrack<IPlayableItem> which only includes the Type prop (as per the interface declaration).

While inspecting the item list in the debugger and logging the serialized string value of the object - everything seems correct, but both when trying to access the values in a loop and while trying to redirect the values through http - the only properties on a track are the ones of PlaylistTrack. Am i missing some kind of type declaration/cast?

I've been looking at the PlayableItemConverter and it seems that the outcome i am getting is impossible (the worst case - should throw an exception of incorrect track type) although i may be missing something myself.

Additional observations

JohnnyCrazy commented 2 months ago

Hi

https://johnnycrazy.github.io/SpotifyAPI-NET/docs/iplayableitem

ArseniSkobelev commented 2 months ago

Hi

https://johnnycrazy.github.io/SpotifyAPI-NET/docs/iplayableitem

It seems that my doc reading skills need an improvement 🙈 Sorry for that and thank you for the quick answer!