mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 00:05:55 +03:00
[GH-ISSUE #1448] Expose updates from other connect devices when not active #649
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#649
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @photovoltex on GitHub (Jan 18, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1448
Is your feature request related to a problem? Please describe.
When implementing
librespotas client (mostly GUI related) and not being the active connect device, there isn't any option to update the client UI as the remote events/updates are not exposed.Describe the solution you'd like
It would be nice to call a similar method like
player_event_handleron the spirc instance to retrieve a channel that exposes remote updates. Additionally we could also provide some local updates that exposes internal knowledge like the current next and previous tracks for example.Additional context
ClusterUpdatePutStateRequest@hrkfdn commented on GitHub (Sep 1, 2025):
This is nice. There's already a bunch of useful events to keep track of the player, but one challenge I'm seeing is how to keep track of the playback context, i.e. expose changes to the current playlist or queue.
It could also be useful to offer APIs for context manipulation, for instance when the user removes a track from the queue (that is not a playlist). Though I'm not sure if that's even feasible.
@photovoltex commented on GitHub (Sep 1, 2025):
Yeah that should also be be doable. As we are the active device we don't need to go over any apis we can just modify the next tracks which are just a mix of context, queue and autoplay items depending on the current state. After "publishing" the state again, the passive connect devices update their state to the active state. Anyhow...
Yes that's the biggest part we have to get right. I see two options currently:
prev_tracksandnext_tracks@hrkfdn commented on GitHub (Sep 1, 2025):
I can only speak for myself/ncspot, of course. So some of this may not necessarily make sense from a library perspective, buuuut:
Maybe the first option is good as an MVP approach? I think just forwarding the entire state/sending events on changes could already be a win and maybe flexible is actually good, not sure if all of the ncspot behavior even translates to Spotify Connect clients 😅
@photovoltex commented on GitHub (Sep 9, 2025):
I made a quick initial implementation (https://github.com/photovoltex/librespot/tree/feat/forward-player-state) where it just forwards the underlying
PlayerState. This is pretty ruff so I will probably look into how we can make it easier to work with.