mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-07 18:16: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>,
|
author: Option<String>,
|
||||||
invalid: bool,
|
invalid: bool,
|
||||||
},
|
},
|
||||||
|
Unknown {
|
||||||
|
hash: Arc<str>,
|
||||||
|
file_type: &'static FileType,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Entry {
|
impl Entry {
|
||||||
pub fn new (root: &impl AsRef<Path>, entry: &DirEntry) -> Perhaps<Self> {
|
pub fn new (root: &impl AsRef<Path>, entry: &DirEntry) -> Perhaps<Self> {
|
||||||
|
println!("{}", entry.path().display());
|
||||||
if entry.path().is_dir() {
|
if entry.path().is_dir() {
|
||||||
Self::new_dir(root, entry)
|
Self::new_dir(root, entry)
|
||||||
} else if entry.path().is_file() {
|
} else if entry.path().is_file() {
|
||||||
|
|
@ -168,7 +173,10 @@ impl Entry {
|
||||||
author: None,
|
author: None,
|
||||||
invalid: false,
|
invalid: false,
|
||||||
},
|
},
|
||||||
_ => return Ok(None)
|
_ => EntryInfo::Unknown {
|
||||||
|
file_type,
|
||||||
|
hash: hash.into(),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ impl Entry {
|
||||||
} else if self.is_mus() {
|
} else if self.is_mus() {
|
||||||
""
|
""
|
||||||
} else {
|
} else {
|
||||||
" "
|
"⁇"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn style (&self) -> Option<Style> {
|
fn style (&self) -> Option<Style> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue