Yooooomi / your_spotify

Self hosted Spotify tracking dashboard
GNU General Public License v3.0
2.82k stars 113 forks source link

Doesn't track group sessions #217

Open advilm opened 1 year ago

advilm commented 1 year ago

Describe the bug

The songs I listen to when I am in a group session aren't tracked in the dashboard.

I am aware that in the Spotify mobile app it doesn't track, so maybe your_spotify tracks it in the same way? I also use last.fm and it does track the songs I listen to when I am in a group session properly.

Yooooomi commented 1 year ago

Hello! It would be interesting to know how last.fm achieves this. According to https://developer.spotify.com/documentation/general/guides/authorization/scopes/#user-read-recently-played, it seems like there is only one endpoint to fetch the recently played songs, and no other scopes allow to read privately played or group session songs.

I don't know where this is issue is going, maybe I'll do a bit of research for this, but it feels like public endpoints would not allow me to do this.

advilm commented 1 year ago

Last.fm also shows the song you are currently listening to. Is it possible that songs you listen to in group sessions are available through a "currently playing track" type of endpoint that last.fm could be using?

Yooooomi commented 1 year ago

There actually is a currently playing endpoint. However, I don't think that's how they record the users history as it would be way too expensive. Maybe you can play along with the endpoint to know if it's recognizing if you're in a group session or not.

advilm commented 1 year ago

When I try to connect spotify to last.fm, under view your activity it says "the content you are playing and Spotify Connect devices information" while on your_spotify it says "content you have recently played."

Maybe it actually does use currently playing track information? I believe maybe it checks current song, then based on how much time is left in the song it knows when to check again. That way it doesn't have to constantly poll the API.