From e86fbda1445ab686db610a4406c4ce7ba8cb0522 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Mon, 18 Aug 2025 09:16:37 -0300 Subject: [PATCH] feat: rename magic meta fields to remove prefix --- src/meta_plugin/magic.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/meta_plugin/magic.rs b/src/meta_plugin/magic.rs index 9406e8b..d3578d0 100644 --- a/src/meta_plugin/magic.rs +++ b/src/meta_plugin/magic.rs @@ -62,7 +62,7 @@ impl MagicFileMetaPlugin { if !file_type.is_empty() { let meta = crate::db::Meta { id: item_id, - name: "magic_file_type".to_string(), + name: "file_type".to_string(), value: file_type, }; let _ = crate::db::store_meta(conn_ref, meta); @@ -74,7 +74,7 @@ impl MagicFileMetaPlugin { if !mime_type.is_empty() { let meta = crate::db::Meta { id: item_id, - name: "magic_mime_type".to_string(), + name: "mime_type".to_string(), value: mime_type, }; let _ = crate::db::store_meta(conn_ref, meta); @@ -86,25 +86,13 @@ impl MagicFileMetaPlugin { if !mime_encoding.is_empty() { let meta = crate::db::Meta { id: item_id, - name: "magic_mime_encoding".to_string(), + name: "mime_encoding".to_string(), value: mime_encoding, }; let _ = crate::db::store_meta(conn_ref, meta); } } - // Save combined MIME info (type and encoding together) - if let Ok(mime_combined) = self.get_magic_result(CookieFlags::MIME) { - if !mime_combined.is_empty() { - let meta = crate::db::Meta { - id: item_id, - name: "magic_mime_combined".to_string(), - value: mime_combined, - }; - let _ = crate::db::store_meta(conn_ref, meta); - } - } - self.is_saved = true; } Ok(())