Polochon-street / blissify-rs

bliss bindings for MPD.
30 stars 6 forks source link

Remove port from default `MPD_HOST` warning #45

Closed naglis closed 10 months ago

naglis commented 10 months ago

Right now, if both MPD_HOST and MPD_PORT environment variables are not set, you would get two warnings, e.g.:

[2024-01-08T08:54:08Z WARN blissify] Could not find any MPD_HOST environment variable set. Defaulting to 127.0.0.1:6600. [2024-01-08T08:54:08Z WARN blissify] Could not find any MPD_PORT environment variable set. Defaulting to 6600.

where the port 6600 is repeated in both messages. This can be misleading in case the user has only MPD_PORT set to e.g. 6601 - the user would get the first warning:

[2024-01-08T08:54:08Z WARN blissify] Could not find any MPD_HOST environment variable set. Defaulting to 127.0.0.1:6600.

but blissify would be acutally connecting on the 6601 port, which would be misleading.

Also, in the code, the port is not being set when MPD_HOST is not set.

Polochon-street commented 10 months ago

Makes sense - that's also mpc's behavior. Thanks for submitting :)