Issue #497 - Playing songs from android app (#501)

* Issue #497 - Playing songs from android app

Implement the fix suggested by @Johannesd3

* Fix formatting
This commit is contained in:
engineergreen 2020-07-22 15:28:39 +01:00 committed by GitHub
parent 4e4557da8d
commit f83915e212
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -790,7 +790,11 @@ impl SpircTask {
}
MessageType::kMessageTypeNotify => {
if self.device.get_is_active() && frame.get_device_state().get_is_active() {
if self.device.get_is_active()
&& frame.get_device_state().get_is_active()
&& self.device.get_became_active_at()
<= frame.get_device_state().get_became_active_at()
{
self.device.set_is_active(false);
self.state.set_status(PlayStatus::kPlayStatusStop);
self.player.stop();