spot icon indicating copy to clipboard operation
spot copied to clipboard

[RFE] Spotify Connect support

Open Jakuje opened this issue 4 years ago • 13 comments

I am using spotify connect a lot to play music on different devices around the home (running mostly raspotify) and controlling them from other devices (phones, laptop) so it came as a disappointment that this client does not support the connect protocol, does not show up in the devices selection and can not allow me to control music playing on other device. I think this support is already in librespot so it should not be that complicated to add (but I did not investigate in detail).

Jakuje avatar Feb 17 '21 11:02 Jakuje

Hi! Thanks for your interest in the project. librespot does support connect for authentication, not so sure about playback control -- looks like it would involve some work on my end! I'll dig eventually into it, but it is not a top priority for me atm to be honest :)

xou816 avatar Feb 17 '21 20:02 xou816

Thank you for your work! Spot works great for me so far. Looks like this rfe caught some attention so it looks like a common use case.

The librespot links spotcontrol, which should do exactly this (but in go ...) so it should be technically possible. If my list of things that I would like to work on would be a bit shorter, I would offer to have a look into that but this still hangs under the "learn rust". But maybe somebody else will be able to jump on that :)

Jakuje avatar Feb 17 '21 22:02 Jakuje

the rspotify crate provides APIs for this; it's what's used by spotify-tui. I'm going to look into implementing this because I would really like this feature.

Ella-0 avatar Oct 08 '21 07:10 Ella-0

Hi! Thank you for taking a look at this :)

Here a few pointers/an overview of the implementation which I had in mind:

  • the UI should be updated to allow selecting between devices, don't hesitate to sketch it first so we can agree on a design for this :) ;
  • the list of devices can be fetched once the AppEvent::LoginEvent(LoginEvent::LoginCompleted(_)) event fires;
  • the app state should be updated to know about which device is selected; either a Device::Local or a Device::Remote(some_id);
  • depending on that value, the PlayerNotifier either controls librespot as it currently does, or it controls another device over HTTP.

As for the HTTP calls, I would recommend not using rspotify since we already have a HTTP client, which just needs to implement the extra endpoints.

I have limited time to contribute, but I always have the time for quick messages like this one, don't hesitate if you have questions! As you can see, there are multiple tasks that we could even share if needed!

xou816 avatar Oct 08 '21 12:10 xou816

As for the HTTP calls, I would recommend not using rspotify since we already have a HTTP client, which just needs to implement the extra endpoints.

Ah okay, I will look into this.

Ella-0 avatar Oct 08 '21 13:10 Ella-0

Update on this, I have a very hacky prototype working :partying_face:

Ella-0 avatar Oct 08 '21 19:10 Ella-0

That was fast :) thanks! I don't think I'll have time to review this this weekend, or maybe just general remarks

xou816 avatar Oct 08 '21 23:10 xou816

Hey is there any update on this?

Savanta avatar Feb 10 '23 20:02 Savanta

hi! I was away a long while, but I had a branch for spotify connect that was WIP : #427

I could have a look again, but I remember it being fairly painful to implement

xou816 avatar Feb 18 '23 16:02 xou816

Would also love to see this feature!

johnmmcgee avatar Mar 06 '23 13:03 johnmmcgee

Would love to see this as well. I use car thing to have separate controls for what I'm playing. But it relies on spotify connect to work. If Spot had it, I could ditch the official app again!

But I also understand if it is too much of a nightmare to implement.

jpsnyder avatar Mar 06 '23 14:03 jpsnyder