feat: Add the ability to share scrobbles with other users #515
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
This change adds a "ListenWith" feature to Subsonic, allowing a user to indicate that they are "listening along" with a friend, and have that friend's Scrobbles tracked on their LastFM/ListenBrainz accounts.
This is achieved via a
listenwith
package which creates an in-memory map of a user (the one submitting the scrobbles) to a set of listeners (those who are "listening along" with the user). An in-memory data structure was chosen to avoid making changes to the database schema, and because this kind of activity is inherently transient, so the cost of storing it persistently seemed unwarranted.A user can start/stop listening with someone by using the appropriate API call. These are currently exposed through a UI on the web interface:
start
adds the current user to that user's set of Listeners. Any Scrobbles the selected user makes until thestop
button is selected will be scrobbled for the logged in user as well.stop
will remove the current user from that user's set of Listeners, and Scrobbling behavior returns to normal.Why
This is probably mostly useful if you're of the "Scrobble everything" mentality, as I am. Too often I've found myself riding in the car or otherwise hanging out with another user on my Gonic instance who is playing the music, only to feel a pang of regret that my LastFM/ListenBrainz statistics won't reflect that I've been happily listening along with them. This is my totally selfish attempt to fix that issue.
I'm currently running a forked version of Gonic which adds the code below, so I figured I'd offer to upstream it to the community.
Here's a picture of the resulting UI:
And when listening along to another user:
Limitations
Currently no subsonic clients support this functionality, so the UX is perhaps not as great as it could be; it currently requires logging in to the web UI and using the dropdown that I added). I have doubts whether this would have any luck getting added as a feature in any existing clients, as they generally aim for features specifically laid out in the subsonic spec.