diff --git a/backend/src/thumbnailer.rs b/backend/src/thumbnailer.rs index 2dd47da..7e34a79 100644 --- a/backend/src/thumbnailer.rs +++ b/backend/src/thumbnailer.rs @@ -38,6 +38,14 @@ impl Thumbnailer { Ok(t) } + /// Load all thumbanilers available in the system + pub fn load_all() -> Result> { + Ok(fs::read_dir("/usr/share/thumbnailers")? + .filter_map(|f| f.ok()) + .filter_map(|f| Thumbnailer::load(&*f.path()).ok()) + .collect()) + } + /// Check if this thumbnailer should run on a specific mime type pub fn check(&self, mime: &str) -> bool { self.mime_type.contains(mime)