spotishell icon indicating copy to clipboard operation
spotishell copied to clipboard

`played_at` should be avilable when getting recently played tracks

Open kimipsen opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. When fetching tracks with Get-RecentlyPlayedTracks as it is at the moment, no information regarding playback timestamp is available in spotishell, but the API does mention it being available (played_at). A (re-)write to allow getting this information would solve the problem. The simplest change is to change $Response.items.track to $Response.items at the end of the function. But this would be a breaking change.

Describe the solution you'd like I would like to be able to get the played_at value for each track. That way I might be able to page through my recently played tracks, using a combination of Limit and BeforeTimestamp/AfterTimestamp.

Describe alternatives you've considered I considered adding an additional argument to Get-RecentlyPlayedTracks - something similar to a flag, eg. -ItemsNotTracks and then inside the function simply check on this, and either use the current logic when the flag is missing and then use the new logic when it is available.

$tracks = Get-RecentlyPlayedTracks #Would work as is
$items = Get-RecentlyPlayedTracks -ItemsNotTracks #would return items, which has (atleast) 2 properties: `played_at`, `track`

kimipsen avatar Sep 05 '23 07:09 kimipsen