Rigellute / spotify-tui

Spotify for the terminal written in Rust 🚀
MIT License
17.6k stars 525 forks source link

spt keeps returning to error when I connect to Sonos #1111

Open koenichiwa opened 11 months ago

koenichiwa commented 11 months ago

The Sonos box is not detected by spt. This is handled in #426.

When I change the device with another Spotify player to my Sonos box, spt shows an extensive error message, which I can't copy/paste: a convert failure due to a null. The only variable that seems to be null is context.

There is a prompt to "click esc to return", but when I do that, it shows the main window shortly and immediately returns to the error message. This means that I can't control spt in any way anymore when a song is played from my Sonos speaker, and I have to return to the standard Spotify player.

I'm willing to help resolve this issue, but I will need guidance.

doomuch commented 11 months ago

Yes, for me it's the same! And your issue was the first in the issue list for me (god thank you)

{
  "device" : {
    "id" : null,
    "is_active" : true,
    "is_private_session" : false,
    "is_restricted" : true,
    "name" : "Sonos Ream",
    "supports_volume" : true,
    "type" : "Speaker",
    "volume_percent" : 26
  },
  "shuffle_state" : false,
  "repeat_state" : "context",
  "timestamp" : 1702737003008,
  "context" : {
    "external_urls" : {
      "spotify" : "https://open.spotify.com/playlist/37i9dQZEVXcOngvkeB8XNX"
    },
    "href" : "https://api.spotify.com/v1/playlists/37i9dQZEVXcOngvkeB8XNX",
    "type" : "playlist",
    "uri" : "spotify:playlist:37i9dQZEVXcOngvkeB8XNX"
  },
  "progress_ms" : 200437
}
doomuch commented 11 months ago

Maybe it would help just to allow the device ID null