mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 09:36:42 +01:00
collect unknowns too
This commit is contained in:
parent
c3676e7b62
commit
5d7c2054b3
2 changed files with 10 additions and 2 deletions
10
src/model.rs
10
src/model.rs
|
|
@ -103,10 +103,15 @@ pub enum EntryInfo {
|
|||
author: Option<String>,
|
||||
invalid: bool,
|
||||
},
|
||||
Unknown {
|
||||
hash: Arc<str>,
|
||||
file_type: &'static FileType,
|
||||
}
|
||||
}
|
||||
|
||||
impl Entry {
|
||||
pub fn new (root: &impl AsRef<Path>, entry: &DirEntry) -> Perhaps<Self> {
|
||||
println!("{}", entry.path().display());
|
||||
if entry.path().is_dir() {
|
||||
Self::new_dir(root, entry)
|
||||
} else if entry.path().is_file() {
|
||||
|
|
@ -168,7 +173,10 @@ impl Entry {
|
|||
author: None,
|
||||
invalid: false,
|
||||
},
|
||||
_ => return Ok(None)
|
||||
_ => EntryInfo::Unknown {
|
||||
file_type,
|
||||
hash: hash.into(),
|
||||
}
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ impl Entry {
|
|||
} else if self.is_mus() {
|
||||
""
|
||||
} else {
|
||||
" "
|
||||
"⁇"
|
||||
}
|
||||
}
|
||||
fn style (&self) -> Option<Style> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue