kimtore / pms

Practical Music Search is an interactive Vim-like console client for the Music Player Daemon.
https://ambientsound.github.io/pms/
MIT License
249 stars 23 forks source link

Add UNIX socket support #127

Closed orangeturtle739 closed 4 years ago

orangeturtle739 commented 4 years ago

Resolves #111.

codecov-commenter commented 4 years ago

Codecov Report

Merging #127 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #127   +/-   ##
=======================================
  Coverage   51.73%   51.73%           
=======================================
  Files          53       53           
  Lines        1900     1900           
=======================================
  Hits          983      983           
  Misses        891      891           
  Partials       26       26           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0f72e8e...3ad8f15. Read the comment docs.

orangeturtle739 commented 4 years ago

I just formatted it.

Regarding the explicit flag / unix: prefix, the reason I did it this way was for compatibility with mpc (and other MPD clients). MPC works this way:

The host to connect to; if not given, the value of the environment variable MPD_HOST is checked before defaulting to localhost. This default can be changed at compile-time.

To use a password, provide a value of the form "password@host".

If you specify an absolute path, mpc attempts a connection via Unix Domain Socket.

I do agree it feels a bit hacky to just check for a leading slash, but then I can have MPD_HOST set, and many different MPD clients will work.

kimtore commented 4 years ago

I see. This puts things in a different light; indeed it must be better to keep MPD_HOST compatibility across clients than to be dogmatic about specifying the socket type. I will merge this, thanks for contributing :)