Use 'modified()' instead of 'created()' to get the file time.
authorGreg Burri <greg.burri@gmail.com>
Wed, 17 Mar 2021 21:11:30 +0000 (22:11 +0100)
committerGreg Burri <greg.burri@gmail.com>
Wed, 17 Mar 2021 21:11:30 +0000 (22:11 +0100)
backend/src/valheim_controller.rs

index ea502b0..72eb60e 100644 (file)
@@ -110,7 +110,7 @@ fn get_last_backup_datetime(backup_path: &str) -> Option<SystemTime> {
         fs::read_dir(backup_path).ok()?.filter_map(\r
             |e| {\r
                 let dir = e.ok()?;\r
-                if dir.path().is_file() { Some(dir.metadata().ok()?.created().ok()?) } else { None }\r
+                if dir.path().is_file() { Some(dir.metadata().ok()?.modified().ok()?) } else { None }\r
             }\r
         )\r
         .collect::<Vec<SystemTime>>();\r