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

Websocket Event inactiveSession is not always sent after playback ended #497

Open
DrRSatzteil opened this issue Jun 5, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@DrRSatzteil
Copy link

Describe the bug
I use the websocket event inactiveSession to start a timer that shuts down the system after a couple of minutes after the playback ended. Unfortunately I do not always get an inactiveSession message after playback has stopped and thus the player keeps running until someone manually switches it off or the battery runs flat.

To Reproduce
It seems that this event is not generated when the playback ends after the last song of a playlist has been played. I just observed the following:

  1. Start to play a playlist via Spotify connect from my Laptop
  2. Wait until the last song on the playllist has finished playing
  3. After the last song I get the following events (excerpts) in this order:
  • {"event":"playbackEnded"}
  • {"event":"trackChanged","userInitiated":false,"...dQ0ErIVIxELlxIgNUYxnO"}
  • {"event":"metadataAvailable","track":{"gid":"AB...4A7B32050F0C66E138F"}}}

My observation is that this last track change and metadata events change the current track back to the first track of my playlist which I did not expect to happen. However given the fact that the playback is finished and the next play command should start the playlist from the beginning this absolutely makes sense. However I do not receive an inactiveSession event afterwards. I do however receive an inactiveSession event a couple of seconds after I pause the playback.

Expected behavior
I would expect to receive an inactiveSession event when the playback has ended for whatever reasons. Alternatively, if this is the expected behaviour I would like to have another way of determining that the player is currently not playing anything. I tried to start the shutdown countdown for playbackEnded events and stop the countdown for trackChanged events but this also does not work since the last event after a playlist is finished is always a trackChanged followed by a metadataAvailable.

Screenshots/Stracktraces/Logs
N/A

Version/Commit
Version 1.6.2

@DrRSatzteil DrRSatzteil added the bug Something isn't working label Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant