inflatablefriends / lastfm

Portable .Net library for Last.fm
Other
100 stars 62 forks source link

Missing attributes of User.GetRecentTracks #134

Closed klinge closed 5 years ago

klinge commented 5 years ago

I'm trying to get recent tracks for a user and display them using pagination.

In UserApi I find a method called UserApi.GetRecentScrobbles (I find no method called GetRecentTracks). GetRecentScrobbles works well for getting a users recent tracks, but it returns an array of LastTrack:s and nothing else.

According to the lastfm api (https://www.last.fm/api/show/user.getRecentTracks) the response has a few attributes as well namely: user="username" page="int" perPage="int" totalPages="int"

Is there a way to get these attributes fron UserApi.GetRecentScrobbles?

rikkit commented 5 years ago

Hi @klinge,

UserApi.GetRecentScrobbles calls the user.getRecentTracks API. It returns a PageResponse<LastTrack>. On PageResponse<T> objects, there are the properties Page, PageSize, TotalItems, TotalPages - see the source here. These properties are available on every API response that returns a list of items.

The user property is not available. However UserApi.GetRecentScrobbles and other UserApi methods require you to pass this in as an argument. Do you have any reason why it needs to be made available on the response object (other than convenience)?

klinge commented 5 years ago

Thanks for the quick reply. I missed that the properties for paging were returned in the PageResponse. And regarding the user property there is no need to have it in the response object. So please feel free to close this issue.