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

Wishlist: HTTP command to check interface version #597

Closed
fatg3erman opened this Issue Dec 1, 2013 · 8 comments

Comments

3 participants
@fatg3erman
Contributor

fatg3erman commented Dec 1, 2013

It would be useful to have an HTTP API command (eg mopidy.getVersion) that would return the current mopidy version so that clients can check they are compatible with it. I'm currently updating mine (RompR) to work with mopidy 0.17 and would like to be able to warn users that their version of mopidy is out of date if they're running an earlier version.

@jodal

This comment has been minimized.

Member

jodal commented Dec 2, 2013

+1

@fatg3erman

This comment has been minimized.

Contributor

fatg3erman commented Dec 8, 2013

Another related idea. My client assumes that it's talking to mpd and it's up to users to choose to use the mopidy HTTP interface. it appears that a lot of users are not reading the docs (!). What would be nice would be to have an mpd command that I could use which would tell me (a) I'm talking to mopidy and (b) the HTTP interface is available. I could then automatically switch to the HTTP interface (which is better in oh so many ways) and users would be none the wiser but would get a better experience.
It would obviously be up to my client to handle the case where this command returns an error when used with mpd, but that would be trivial.

@kingosticks

This comment has been minimized.

Member

kingosticks commented Dec 9, 2013

Could you perhaps make use of the new support for zeroconf to find the
advertised http interface?
#39
On 8 Dec 2013 22:52, "fatg3erman" notifications@github.com wrote:

Another related idea. My client assumes that it's talking to mpd and it's
up to users to choose to use the mopidy HTTP interface. it appears that a
lot of users are not reading the docs (!). What would be nice would be to
have an mpd command that I could use which would tell me (a) I'm talking to
mopidy and (b) the HTTP interface is available. I could then automatically
switch to the HTTP interface (which is better in oh so many ways) and users
would be none the wiser but would get a better experience.
It would obviously be up to my client to handle the case where this
command returns an error when used with mpd, but that would be trivial.


Reply to this email directly or view it on GitHubhttps://github.com//issues/597#issuecomment-30095459
.

@fatg3erman

This comment has been minimized.

Contributor

fatg3erman commented Dec 9, 2013

It's a great idea. Do you know if this is possible in Javascript from within a browser - I can't find much on the web.

@kingosticks

This comment has been minimized.

Member

kingosticks commented Dec 9, 2013

Sadly... my idea falls flat on it's face there. I can't find much either, this very old stackoverflow post mentions a W3C draft spec but that seems to be moving very slowly. I'm very surprised to find there's nothing out there for this already.

But if there was a mopidy-only MPD command for something like this you could use the commands reflection to check if it's available. If going off-spec is not an option then maybe we could add a field to the output of status? Presumably existing clients would be agnostic to that.

@kingosticks

This comment has been minimized.

Member

kingosticks commented Dec 9, 2013

Actually, another more extensible alternative to the extra status field might be to use the client-to-client channel features of MPD. Your webclient could attempt to subscribe to the "mopidy" channel where all kinds of extra information could be exposed, including the HTTP interface address & port. The downside of this is that mopidy doesn't currently implement channel functionality so you'd have to do some/all of that. But it's also an excuse to implement more of the protocol which can only be a good thing!

@fatg3erman

This comment has been minimized.

Contributor

fatg3erman commented Dec 15, 2013

Extending mopidy is beyond me, I'm not a python guy :). However I've realised I can easily detect the HTTP API from the php side of my client by simply using curl to attempt to retrieve [address of mpd server]/:6680/mopidy/mopidy.min.js. This works a treat and doesn't require me to figure out zeroconf :)
So back to the original point of this, if there were then an HTTP API command to check the version, then I could ensure I was compatible with it.

@jodal

This comment has been minimized.

Member

jodal commented Dec 15, 2013

Fixed with the merge of #611.

@jodal jodal closed this Dec 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment