From 8d068968c2499b277684a0271642319f1e4a2533 Mon Sep 17 00:00:00 2001
From: naglis <827324+naglis@users.noreply.github.com>
Date: Mon, 8 Jan 2024 10:52:55 +0200
Subject: [PATCH] Remove port from default MPD_HOST warning

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.
---
 src/main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index 9de1081..e3c2bad 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -139,7 +139,7 @@ impl MPDLibrary {
                 Some((password, host)) => (Some(password.to_owned()), host.to_owned()),
             },
             Err(_) => {
-                warn!("Could not find any MPD_HOST environment variable set. Defaulting to 127.0.0.1:6600.");
+                warn!("Could not find any MPD_HOST environment variable set. Defaulting to 127.0.0.1.");
                 (None, String::from("127.0.0.1"))
             }
         };