added: display text when song has no artist and title

This commit is contained in:
Bob van Loosen 2013-01-06 18:20:14 +01:00
parent b3effd71a6
commit 402137ac25

View file

@ -114,13 +114,22 @@ bool CMpdClient::GetCurrentSong()
if (line == "OK") if (line == "OK")
{ {
if (artist.empty()) string songtext;
artist = "Unknown artist"; 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()) songtext = artist + " - " + title;
title = "Unknown title"; }
SetCurrentSong(artist + " - " + title); SetCurrentSong(songtext);
return true; return true;
} }
} }