api2/types: ArchiveEntry: fix inverse 'leaf' value

a 'leaf' node is every file *except* directories, so we have
to reverse the logtic here

this fixes the pxar.didx browser in the web ui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-02-23 15:20:17 +01:00 committed by Dietmar Maurer
parent cba167b874
commit 875d375d7a
1 changed files with 1 additions and 1 deletions

View File

@ -1333,7 +1333,7 @@ impl ArchiveEntry {
text: String::from_utf8_lossy(filepath.split(|x| *x == b'/').last().unwrap())
.to_string(),
entry_type: CatalogEntryType::from(entry_type).to_string(),
leaf: matches!(entry_type, DirEntryAttribute::Directory { .. }),
leaf: !matches!(entry_type, DirEntryAttribute::Directory { .. }),
size: match entry_type {
DirEntryAttribute::File { size, .. } => Some(*size),
_ => None