joerg-krause writes

Commit e306de4ebb55c1a8eb0e03ef60827574b43b3f90 added the initialization of m_stat.state to updStatus(), which is wrong! If MPD is playing, the onplay command will always be executed as _stat.state is always MPDS_UNK.

Fix this issue by doing the initialization of m_stat.state in the constructor.

medoc92 writes

I pushed a slightly different modification where the state field is initialized in the MpdStatus constructor instead, this seems more natural. Please confirm that this works for you.

joerg-krause writes

Right, this is a better approach to initialize the state variable. However, [this](https://github.com/medoc92/upmpdcli/blob/master/src/mpdcli.cxx#L220) line needs to be removed to get it work properly.

medoc92 writes

Yes, I had missed half the change… Should be allright now !