[GH-ISSUE #25] Implement some sort of State handler with some sort of RO-API #13

Closed
opened 2026-02-27 19:28:18 +03:00 by kerem · 4 comments
Owner

Originally created by @sashahilton00 on GitHub (Jan 29, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/25

Issue by psych0d0g
Thursday Jan 14, 2016 at 14:41 GMT
Originally opened as https://github.com/plietar/librespot/issues/37


Is there a way to notice when a device connects / disconnects?
and could we supply some kind of state file for tracking?
what i have in mind is another argument to enable that feature and if enabled create a file where librespot writes the current state (like the proc file system on linux just a single line which gets updated on state changes)
example content of that file:

Device connects:
"connected"

Device disconnects:
"noendpoint"

Device disconnects and no music playing or end of playlist:
"noendpointnotplaying"

Originally created by @sashahilton00 on GitHub (Jan 29, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/25 <a href="https://github.com/psych0d0g"><img src="https://avatars2.githubusercontent.com/u/181302?v=4" align="left" width="96" height="96" hspace="10"></img></a> **Issue by [psych0d0g](https://github.com/psych0d0g)** _Thursday Jan 14, 2016 at 14:41 GMT_ _Originally opened as https://github.com/plietar/librespot/issues/37_ ---- Is there a way to notice when a device connects / disconnects? and could we supply some kind of state file for tracking? what i have in mind is another argument to enable that feature and if enabled create a file where librespot writes the current state (like the proc file system on linux just a single line which gets updated on state changes) example content of that file: Device connects: "connected" Device disconnects: "noendpoint" Device disconnects and no music playing or end of playlist: "noendpointnotplaying"
kerem 2026-02-27 19:28:18 +03:00
  • closed this issue
  • added the
    imported
    label
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by sashahilton00
Monday Jan 18, 2016 at 23:59 GMT


Agreed, this is a must have for the library given that it is going to be standalone. As per the gitter chat, here is a list of possible event emitters that it would be good to have:

  • Track Start
  • Track Finish
  • Track Change
  • Track Play
  • Track Pause
  • Track Stop
  • Track Rewind/Fast Forward
  • Track Seek Position
  • Track Shuffle/Repeat enabled/disabled
  • Device Connected [See above]
  • Device Disconnected [See above]
  • Device Disconnected no music [See above]
  • Current Track Metadata
  • Playlist Metadata [Track, Artist, Album, Duration]
  • Queue updated
  • Queue Metadata
  • Volume Up/Down

I'm sure there are more, but I think this is more than good enough to start with.

<!-- gh-comment-id:361257474 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/sashahilton00"><img src="https://avatars3.githubusercontent.com/u/4185362?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [sashahilton00](https://github.com/sashahilton00)** _Monday Jan 18, 2016 at 23:59 GMT_ ---- Agreed, this is a must have for the library given that it is going to be standalone. As per the gitter chat, here is a list of possible event emitters that it would be good to have: - Track Start - Track Finish - Track Change - Track Play - Track Pause - Track Stop - Track Rewind/Fast Forward - Track Seek Position - Track Shuffle/Repeat enabled/disabled - Device Connected [See above] - Device Disconnected [See above] - Device Disconnected no music [See above] - Current Track Metadata - Playlist Metadata [Track, Artist, Album, Duration] - Queue updated - Queue Metadata - Volume Up/Down I'm sure there are more, but I think this is more than good enough to start with.
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by CoDEmanX
Tuesday Jan 19, 2016 at 00:08 GMT


Native Spotify clients seem to periodically report playback progress to their servers, maybe that's another possible event (some kind of a heartbeat).

There are also a couple error events, like not authorized (anymore), song not available in target market, too many requests, premium required, app key invalid/banned...

<!-- gh-comment-id:361257487 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/CoDEmanX"><img src="https://avatars1.githubusercontent.com/u/1309249?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [CoDEmanX](https://github.com/CoDEmanX)** _Tuesday Jan 19, 2016 at 00:08 GMT_ ---- Native Spotify clients seem to periodically report playback progress to their servers, maybe that's another possible event (some kind of a heartbeat). There are also a couple error events, like not authorized (anymore), song not available in target market, too many requests, premium required, app key invalid/banned...
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by sashahilton00
Tuesday Jan 19, 2016 at 00:08 GMT


Good point, I forgot about the errors.

<!-- gh-comment-id:361257507 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/sashahilton00"><img src="https://avatars3.githubusercontent.com/u/4185362?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [sashahilton00](https://github.com/sashahilton00)** _Tuesday Jan 19, 2016 at 00:08 GMT_ ---- Good point, I forgot about the errors.
Author
Owner

@sashahilton00 commented on GitHub (Feb 1, 2018):

Closing this, as it comes under the broader issue of Metadata, which is being tracked in #7

<!-- gh-comment-id:362127091 --> @sashahilton00 commented on GitHub (Feb 1, 2018): Closing this, as it comes under the broader issue of Metadata, which is being tracked in #7
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#13
No description provided.