diff --git a/markbase-core/src/webdav.rs b/markbase-core/src/webdav.rs index 9b64329..7601e52 100644 --- a/markbase-core/src/webdav.rs +++ b/markbase-core/src/webdav.rs @@ -127,6 +127,7 @@ impl VfsDavFs { }; let entries: HashMap> = data .iter() + .filter(|(_, v)| !v.is_empty()) .map(|(k, v)| (k.clone(), v.iter().map(DeadPropEntry::from).collect())) .collect(); if let Ok(json) = serde_json::to_string(&entries) { @@ -229,14 +230,17 @@ pub struct VfsDavMetaData { len: u64, is_dir: bool, modified: SystemTime, + accessed: SystemTime, } impl VfsDavMetaData { pub fn new(len: u64, is_dir: bool) -> Self { + let now = SystemTime::now(); Self { len, is_dir, - modified: SystemTime::now(), + modified: now, + accessed: now, } } @@ -245,6 +249,7 @@ impl VfsDavMetaData { len: stat.size, is_dir: stat.is_dir, modified: stat.mtime, + accessed: stat.atime, } } } @@ -261,6 +266,10 @@ impl DavMetaData for VfsDavMetaData { fn is_dir(&self) -> bool { self.is_dir } + + fn accessed(&self) -> Result { + Ok(self.accessed) + } } #[derive(Debug, Clone)] @@ -814,6 +823,7 @@ impl DavFileSystem for VfsDavFs { } }; map.iter() + .filter(|(_, v)| !v.is_empty()) .map(|(k, v)| (k.clone(), v.iter().map(DeadPropEntry::from).collect())) .collect() };