From 394a1a7b7951772f17416030e21264fa97e8ace4 Mon Sep 17 00:00:00 2001 From: Goh Wei Wen Date: Sat, 24 Jun 2023 01:17:27 +0800 Subject: [PATCH] fix: move update_play_time to alliumd --- alliumd/src/alliumd.rs | 1 + common/src/platform/miyoo/mod.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/alliumd/src/alliumd.rs b/alliumd/src/alliumd.rs index ee21d320..d81934d4 100644 --- a/alliumd/src/alliumd.rs +++ b/alliumd/src/alliumd.rs @@ -248,6 +248,7 @@ impl AlliumD { self.main.wait().await?; } self.save()?; + self.update_play_time()?; self.platform.shutdown()?; Ok(()) } diff --git a/common/src/platform/miyoo/mod.rs b/common/src/platform/miyoo/mod.rs index 2a4658b9..40e5268b 100644 --- a/common/src/platform/miyoo/mod.rs +++ b/common/src/platform/miyoo/mod.rs @@ -5,6 +5,7 @@ mod screen; mod volume; use std::fmt; +use std::os::unix::process::CommandExt; use std::process::Command; use anyhow::Result; @@ -71,11 +72,10 @@ impl Platform for MiyooPlatform { fn shutdown(&self) -> Result<()> { #[cfg(unix)] { - self.update_play_time()?; std::process::Command::new("sync").spawn()?; match self.model { MiyooDeviceModel::Miyoo283 => { - std::process::Command::new("reboot").exec()?; + std::process::Command::new("reboot").exec(); } MiyooDeviceModel::Miyoo354 => { std::process::Command::new("poweroff").exec();