fix(mpd): use timers with second granularity where possible

Reuse already armed timer in Disconnected state.
This commit is contained in:
Aleksei Bavshin
2024-03-01 00:06:54 -08:00
parent 653c24cee1
commit bb60d41842
3 changed files with 16 additions and 11 deletions

View File

@ -53,10 +53,10 @@ auto waybar::modules::MPD::update() -> void {
void waybar::modules::MPD::queryMPD() {
if (connection_ != nullptr) {
spdlog::debug("{}: fetching state information", module_name_);
spdlog::trace("{}: fetching state information", module_name_);
try {
fetchState();
spdlog::debug("{}: fetch complete", module_name_);
spdlog::trace("{}: fetch complete", module_name_);
} catch (std::exception const& e) {
spdlog::error("{}: {}", module_name_, e.what());
state_ = MPD_STATE_UNKNOWN;