-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
feat: MPD server #487
base: master
Are you sure you want to change the base?
feat: MPD server #487
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some comments to not forget things, since I took a quick look with fresh eyes.
return c.srv.jukebox.TogglePlay() | ||
|
||
case state == "1" || state == "0": | ||
return c.srv.jukebox.SetPlay(state == "0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename state
to pause
to make the comparison clear.
return c.srv.jukebox.SetPlay(state == "0") | ||
|
||
default: | ||
return c.newErr(ackErrorArg, fmt.Errorf("play state must be 0 or 1, got: %s", state)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return c.newErr(ackErrorArg, fmt.Errorf("play state must be 0 or 1, got: %s", state)) | |
return c.newErr(ackErrorArg, fmt.Errorf("pause state must be 0 or 1, got: %s", state)) |
} | ||
|
||
func doCmd(c *client, name string, args *argParser) error { | ||
fmt.Println("->", args.line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be removed/made into a proper log.
) | ||
|
||
const ( | ||
protocolVersion = "0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put something here when enough of the protocol is supported.
c5b3a1c
to
86fd590
Compare
Why make it part of gonic though? It makes more sense to have it as a separate executable, that you can slap on top of any Subsonic-compatible server. This Mopidy plugin is looking for a maintainer, by the way: https://github.com/Prior99/mopidy-subidy |
@lomereiter Having a separate server seems a lot harder, and less optimized, since you can only use the public APIs, not reach for the DB/functions directly. And on top of that you now need to support/test multiple servers, not "just" multiple clients, so MxN vs N. I am not interested in contributing to Mopidy because I don't want to use it (tried before Gonic FWIW), and because of tech and license reasons. P.S. please consider how you phrase feedback because it sounds like you're dismissing the thought I put into this by using absolute wording like "it makes more sense", and telling me what to do with my time. Hopefully you can understand :) |
Fair enough, I just stated my opinion: I prefer the Unix way when every tool does one thing well. Sorry it came off as abrasive. And I'm not the maintainer, so it doesn't have much weight anyway. I didn't say anything about having to support multiple servers, it could be just Gonic, and whoever needs support for other servers is free to contribute - that's how open source is supposed to work. Using public API is overhead indeed, but the benefit is that it's much more stable and should require almost no maintenance. Whereas if you want to consume Gonic as a library, it first needs a refactoring so that more or less stable interfaces are defined for accessing the DB instead of making queries directly from HTTP handlers, as is the case now (see server/ctrlsubsonic). |
Hi,
I did this as a proof-of-concept. There's no docs, not enough tests and comments, and what's actually implemented from the MPD API is pretty minimal. So I've marked this as a draft and wanted to get feedback before spending any more time on it.
The end goal for me is to be able to control the jukebox via any MPD client, since the jukebox support of Subsonic clients, is subpar from my experience. Ideally in the end being able to steal the queue from device to device, like is possible on the streaming giants.
Please let me know if this is something you'd be interested in merging. I'm willing to handle maintenance/future issues that pop up.