git.lucas.co / cce-files
file manager
git clone https://git.lucas.co/cce-files.git

commitb8c5fd5036c8977a4f91a5a26834cecf8a02a8e5
parent84f354ed5a
authorLucas Galante <[email protected]>
date2026-06-29 15:18
Add fallback KDL mime type detection

 src/services/fs.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/services/fs.rs b/src/services/fs.rs
index b4e7b97..16e49b1 100644
--- a/src/services/fs.rs
+++ b/src/services/fs.rs
@@ -387,6 +387,11 @@ pub fn save_last_dir_internal(dir: &Path) {
 }
 
 pub fn get_mime_type(path: &Path) -> Option<String> {
+    if let Some(ext) = path.extension().and_then(|e| e.to_str()) {
+        if ext.eq_ignore_ascii_case("kdl") {
+            return Some("application/x-kdl".to_string());
+        }
+    }
     let output = std::process::Command::new("xdg-mime")
         .args(&["query", "filetype"])
         .arg(path)