Merge pull request #2046 from 2e0byo/fix/mpd

This commit is contained in:
Alex 2023-03-07 18:12:40 +01:00 committed by GitHub
commit 823c13a8c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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");