Page 1 of 1

new API "getPlayingHistory"

PostPosted: Thu Dec 06, 2018 1:54 am
by nasko
Have been happy Premium user for years.
Would be very very useful to be able to run analytics/statistics about which songs are the most frequently played.
Records like "user X started song Y ON date Z" could be stored in table in the DB and be deleted on regular basis when predefined retention-time expires. (I don't think this would put too much burden on the server). Also, an additional parameter "playedSince=?" would be useful.
Sindre, is this something feasible ?
Thanks for consideration

Re: new API "getPlayingHistory"

PostPosted: Thu Dec 06, 2018 2:01 am
by nasko
wait a minute ... in the "getNowPlaying" API there is a "minutesAgo" field which suggests that a play is retained in the results for some time. This is perfect for my purposes.
I just need to know exactly for how long a play is retained in this API ? 1 hour, 1day ?
How can I change that period ? Would be nice to be exposed in Settings page.
Thanks

Re: new API "getPlayingHistory"

PostPosted: Fri Dec 07, 2018 11:00 am
by acroyear
I think it is 1 hour, which is the amount of time that you'll see songs listed in the main GUI's right sidebar along with the chat section. Also, it only tracks the most recently played song from any particular user/device combination, so you'll need to poll for that and log the results in your own 'client' to eventually assemble the data you want. It is triggered on when the song starts.