From 402137ac253f512d1abde5535081736642c41457 Mon Sep 17 00:00:00 2001 From: Bob van Loosen Date: Sun, 6 Jan 2013 18:20:14 +0100 Subject: [PATCH] added: display text when song has no artist and title --- src/mpdclient.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mpdclient.cpp b/src/mpdclient.cpp index d05a06f..413ac44 100644 --- a/src/mpdclient.cpp +++ b/src/mpdclient.cpp @@ -114,13 +114,22 @@ bool CMpdClient::GetCurrentSong() if (line == "OK") { - if (artist.empty()) - artist = "Unknown artist"; + string songtext; + if (artist.empty() && title.empty()) + { + songtext = "Wat? No title?"; + } + else + { + if (artist.empty()) + artist = "Unknown artist"; + if (title.empty()) + title = "Unknown title"; - if (title.empty()) - title = "Unknown title"; + songtext = artist + " - " + title; + } - SetCurrentSong(artist + " - " + title); + SetCurrentSong(songtext); return true; } }