Skip to content

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

Open
Laevos wants to merge 6 commits intosentriz:masterfrom
Laevos:laevos/listen-with
Open

feat: Add the ability to share scrobbles with other users#515
Laevos wants to merge 6 commits intosentriz:masterfrom
Laevos:laevos/listen-with

Conversation

@Laevos
Copy link
Copy Markdown

@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
Copy Markdown
Author

Laevos commented Jun 9, 2024

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

@sentriz sentriz force-pushed the master branch 5 times, most recently from 7decea6 to 971d22d Compare November 11, 2025 07:01
lurenyang418 pushed a commit to lurenyang418/gonic that referenced this pull request Mar 23, 2026
- Update `overlay` for Modal, still handle click out to dismiss, even it
no overlay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants