mopidy / mopidy-mpd

Mopidy extension for controlling playback from MPD clients
https://mopidy.com/ext/mpd/
Apache License 2.0
98 stars 20 forks source link

Extend MPD protocol with spotify-specific commands #39

Open arybczak opened 3 years ago

arybczak commented 3 years ago

Hey,

ncmpcpp author here. I've been recently looking into using ncmpcpp with mopidy-spotify so that I don't have to alternate between MPD and the official Spotify client.

However, it looks like it's not possible to have more specific control over Spotify with the MPD protocol, e.g. adding tracks/albums/artists to the collection.

I thought about it for a while and the potential solutions I see are:

1) Make it possible for ncmpcpp to use mopidy-http api instead of the MPD protocol 2) Extend mopidy-mpd with spotify-specific commands so that ncmpcpp (or other mopidy-compatible MPD clients) can support them conditionally after inspecting the output of commands. 3) Give up and fall back to MPD/Spotify.

(1) is a lot of work that I don't have time for and (3) isn't very satisfying, so I'd like to tackle (2) if the idea makes sense to you.

kingosticks commented 3 years ago

What sort of Spotify specific things are you wanting to do? We don't have any support for manipulating the user's My Music collection. Is that the "collection" you are referring to?

arybczak commented 3 years ago

We don't have any support for manipulating the user's My Music collection. Is that the "collection" you are referring to?

Yes. Hmm. I looked at mopidy-iris and it can at least

Doesn't it do it through mopidy?

Looks like it can't add/remove artists though.

Is adding support for these operations to mopidy-spotify problematic in any way?

kingosticks commented 3 years ago

No, it doesn't go through Mopidy. Iris does some calls directly to Spotify's Web API. That's why you have to authorise Iris separately.

Traditionally Mopidy-Spotify only supported things provided by libspotify (which is deprecated and pre-dates My Music, Spotify Connect , etc). We've been moving things over to the Web API where it makes sense. But Mopidy's Core API doesn't have anything that obviously maps to the Spotify-specific My Music collection. We try to avoid anything backend-specific. We might be able to support it through a special playlist, but we don't do that currently.

Edit: if someone comes up with a way of supporting this feature within the constrains of the Mopidy Core API then there's no reason not to add that to Mopidy-Spotify. Even better if it could even fit within the MPD protocol also. If we would need to change the Core API then we'd much prefer to come up with something backend-agnostic.

stacyharper commented 3 years ago

I just discovered it is impossible to search through playlists with mopidy-mpd (spotify playlists in this example).

Is it possible to add some mpd tag ("Playlist") so that requests like "mpc search Playlist foobar" would result in spotify uris ? Or is it something that Mopidy-Spotify should do ? Ideally I'd like not to use the Web extensions for this.

(Anyway it looks like clients like ncmpcpp would not be able to handle those extended tags but maybe the "any" tag would be enough for most use cases).

What are you thoughs about this ? Doable ? Recommendable ?