Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

feat: MPD server #487

wants to merge 2 commits into from

Conversation

ThinkChaos
Copy link

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.

Copy link
Author

@ThinkChaos ThinkChaos left a 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")
Copy link
Author

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))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Author

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"
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant