mirror of
https://github.com/YGGverse/nexy.git
synced 2026-03-31 17:25:27 +00:00
fix hidden directory entries count on show_hidden option is disabled
This commit is contained in:
parent
96c8a829d0
commit
b1360eab2e
1 changed files with 8 additions and 1 deletions
|
|
@ -152,7 +152,14 @@ impl Public {
|
||||||
(true, _) => dirs.push(Dir {
|
(true, _) => dirs.push(Dir {
|
||||||
meta,
|
meta,
|
||||||
name,
|
name,
|
||||||
count: fs::read_dir(e.path()).map_or(0, |i| i.count()),
|
count: fs::read_dir(e.path()).map_or(0, |i| {
|
||||||
|
i.filter_map(Result::ok)
|
||||||
|
.filter(|e| {
|
||||||
|
self.show_hidden
|
||||||
|
|| !e.file_name().to_string_lossy().starts_with('.')
|
||||||
|
})
|
||||||
|
.count()
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
(_, true) => files.push(File { meta, name }),
|
(_, true) => files.push(File { meta, name }),
|
||||||
_ => continue, // @TODO symlinks support?
|
_ => continue, // @TODO symlinks support?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue