status: if current song is not yet in playlist, fetch it from the server
This commit is contained in:
@@ -574,6 +574,11 @@ void Status::Changes::elapsedTime(bool update_elapsed)
|
|||||||
|
|
||||||
std::string ps = playerStateToString(m_player_state);
|
std::string ps = playerStateToString(m_player_state);
|
||||||
MPD::Song np = myPlaylist->nowPlayingSong();
|
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);
|
drawTitle(np);
|
||||||
|
|
||||||
std::string tracklength;
|
std::string tracklength;
|
||||||
|
|||||||
Reference in New Issue
Block a user