Skip to content

Commit

Permalink
Remove port from default MPD_HOST warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
naglis committed Jan 8, 2024
1 parent 2487111 commit 8d06896
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
};
Expand Down

0 comments on commit 8d06896

Please sign in to comment.