nekowinston / mpd-rich-presence

Discord Rich Presence for MPD
MIT License
10 stars 3 forks source link

feat: Add support for UNIX socket #6

Closed nathanielevan closed 11 months ago

nathanielevan commented 11 months ago

[why] At present this app only supports TCP connection to an MPD host. I use a UNIX socket for MPD, and this quick patch should add support for it. Let me know what you think. (I closed the older pull request because I wanted to apply this change on a feature branch first.)

[how] I added a new configuration variable use_socket that takes a Boolean value. If set to true, mpd.Dial() should take "unix" as its first argument, indicating that it's connecting to a UNIX socket, followed by the location of that socket in the filesystem, set by the configuration variable host. The port variable is therefore unused in this mode.