status: if current song is not yet in playlist, fetch it from the server

master
Andrzej Rybczak 11 years ago
parent 4ae9696a7e
commit 076c37af05
  1. 5
      src/status.cpp

@ -574,6 +574,11 @@ void Status::Changes::elapsedTime(bool update_elapsed)
std::string ps = playerStateToString(m_player_state);
MPD::Song np = myPlaylist->nowPlayingSong();
// It may happen that playlist wasn't yet updated
// and current song is not there yet. In such case
// try fetching it from the server.
if (np.empty() && (m_player_state == MPD::psPlay || m_player_state == MPD::psPause))
np = Mpd.GetCurrentSong();
drawTitle(np);
std::string tracklength;

Loading…
Cancel
Save