Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add the ability to share scrobbles with other users #515

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Laevos
Copy link

@Laevos Laevos commented Jun 9, 2024

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:

  • A drop-down list of all users (besides the logged in user). Picking one of these and hitting start adds the current user to that user's set of Listeners. Any Scrobbles the selected user makes until the stop button is selected will be scrobbled for the logged in user as well.
  • When the user is listening along to at least one other user, a drop down of the current listening buddies is shown. Selecting one of these and hitting 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:

image

And when listening along to another user:

image

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.

@Laevos
Copy link
Author

Laevos commented Jun 9, 2024

Going to re-factor this a bit to get rid of the use of global variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants