Revert "fix #4001: datastore/catalog: add number of files to directory entry"
causes trouble with UI and is inconsistent as its still missing in
file restore (daemon)
We probably want to use a separate property to safe this to avoid
confusion with size.
This reverts commit 66ad63bac2
.
This commit is contained in:
parent
dadaa9e2f0
commit
a7646fe42a
|
@ -706,11 +706,10 @@ impl<R: Read + Seek> CatalogReader<R> {
|
||||||
components.push(b'/');
|
components.push(b'/');
|
||||||
components.extend(&direntry.name);
|
components.extend(&direntry.name);
|
||||||
let mut entry = ArchiveEntry::new(&components, Some(&direntry.attr));
|
let mut entry = ArchiveEntry::new(&components, Some(&direntry.attr));
|
||||||
|
if let DirEntryAttribute::File { size, mtime } = direntry.attr {
|
||||||
if let DirEntryAttribute::Directory { start: _ } = direntry.attr {
|
entry.size = size.into();
|
||||||
entry.size = Some(u64::try_from(self.read_dir(&direntry)?.len())?);
|
entry.mtime = mtime.into();
|
||||||
}
|
}
|
||||||
|
|
||||||
res.push(entry);
|
res.push(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -912,8 +911,7 @@ pub struct ArchiveEntry {
|
||||||
pub entry_type: String,
|
pub entry_type: String,
|
||||||
/// Is this entry a leaf node, or does it have children (i.e. a directory)?
|
/// Is this entry a leaf node, or does it have children (i.e. a directory)?
|
||||||
pub leaf: bool,
|
pub leaf: bool,
|
||||||
/// The file size, if entry_type is 'f' (file) or the amount of files in a
|
/// The file size, if entry_type is 'f' (file)
|
||||||
/// directory if entry_type is 'd' (directory)
|
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub size: Option<u64>,
|
pub size: Option<u64>,
|
||||||
/// The file "last modified" time stamp, if entry_type is 'f' (file)
|
/// The file "last modified" time stamp, if entry_type is 'f' (file)
|
||||||
|
|
Loading…
Reference in New Issue