Properly handle the case where the artist is present but the title is not.

meow-7.2.2
Tonya Souther 2011-03-17 09:54:31 -05:00
parent 299157658d
commit 10e14ceee2
1 changed files with 12 additions and 6 deletions

View File

@ -55,16 +55,22 @@ void StreamTitleDisplay::checkMetadata()
std::string title = gAudiop->getStreamingAudioImpl()->getCurrentTitle();
std::string artist = gAudiop->getStreamingAudioImpl()->getCurrentArtist();
// Sometimes we get blanks...
chat.mText = "";
if(artist.length() > 0)
{
chat.mText = artist;
}
if(title.length() > 0)
{
if(artist.length() > 0)
if (chat.mText.length() > 0)
{
chat.mText = "Now playing: " + artist + " - " + title;
}
else
{
chat.mText = "Now playing: " + title;
chat.mText += " - ";
}
chat.mText += title;
}
if (chat.mText.length() > 0)
{
chat.mText = "Now playing: " + chat.mText;
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLSD args;
args["type"] = LLNotificationsUI::NT_NEARBYCHAT;