collect unknowns too

This commit is contained in:
🪞👃🪞 2025-03-10 12:15:27 +02:00
parent c3676e7b62
commit 5d7c2054b3
2 changed files with 10 additions and 2 deletions

View file

@ -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(),
}
}, },
})) }))
} }

View file

@ -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> {