X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=backend%2Fsrc%2Fvalheim_controller.rs;h=72eb60ef72daeebf3039f232a2dd0880d56f16d0;hb=58d9f48e4cca3e964047563a8bf458fbbaf79bc1;hp=04f75a42b4ef88ce271c307b133e30f258ea55b7;hpb=28dede5779342bac9b4767d61badac099b1595c2;p=valheim_web.git diff --git a/backend/src/valheim_controller.rs b/backend/src/valheim_controller.rs index 04f75a4..72eb60e 100644 --- a/backend/src/valheim_controller.rs +++ b/backend/src/valheim_controller.rs @@ -4,7 +4,7 @@ use std::{ fs, time::SystemTime }; use chrono::{ DateTime, offset::Local }; -#[cfg(target_os = "unix")] +#[cfg(target_os = "linux")] use systemd::journal; #[derive(Clone, Debug)] @@ -72,7 +72,7 @@ fn format_byte_size(bytes: u64, precision: usize) -> String { const VALHEIM_PROCESS_NAME: &str = "valheim_server"; -#[cfg(target_os = "unix")] +#[cfg(target_os = "linux")] fn get_number_of_players() -> u32 { let mut journal = journal::OpenOptions::default().current_user(true).open().unwrap(); @@ -110,7 +110,7 @@ fn get_last_backup_datetime(backup_path: &str) -> Option { fs::read_dir(backup_path).ok()?.filter_map( |e| { let dir = e.ok()?; - if dir.path().is_file() { Some(dir.metadata().ok()?.created().ok()?) } else { None } + if dir.path().is_file() { Some(dir.metadata().ok()?.modified().ok()?) } else { None } } ) .collect::>();