From 3c96881a59a61fe3c7859738217f411dc91d08f5 Mon Sep 17 00:00:00 2001 From: John Maximilian <2e0byo@gmail.com> Date: Tue, 7 Mar 2023 16:48:05 +0000 Subject: [PATCH] fix: mpd bug paused with no song. --- src/modules/mpd/mpd.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/mpd/mpd.cpp b/src/modules/mpd/mpd.cpp index e7288974..008462a9 100644 --- a/src/modules/mpd/mpd.cpp +++ b/src/modules/mpd/mpd.cpp @@ -122,7 +122,10 @@ void waybar::modules::MPD::setLabel() { std::chrono::seconds elapsedTime, totalTime; std::string stateIcon = ""; - if (stopped()) { + bool no_song = song_.get() == nullptr; + if (stopped() || no_song ) { + if (no_song) + spdlog::warn("Bug in mpd: no current song but state is not stopped."); format = config_["format-stopped"].isString() ? config_["format-stopped"].asString() : "stopped"; label_.get_style_context()->add_class("stopped");