Skip to content

Commit

Permalink
fix: move update_play_time to alliumd
Browse files Browse the repository at this point in the history
  • Loading branch information
goweiwen committed Jun 23, 2023
1 parent f07c5b8 commit 394a1a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions alliumd/src/alliumd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ impl AlliumD<DefaultPlatform> {
self.main.wait().await?;
}
self.save()?;
self.update_play_time()?;
self.platform.shutdown()?;
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions common/src/platform/miyoo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod screen;
mod volume;

use std::fmt;
use std::os::unix::process::CommandExt;
use std::process::Command;

use anyhow::Result;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 394a1a7

Please sign in to comment.