fix: remove unused magic_file metadata outputs and fix binary detection timing
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -61,27 +61,13 @@ impl MagicFileMetaPlugin {
|
||||
// Convert raw pointer back to reference (unsafe)
|
||||
let conn_ref = unsafe { &*conn };
|
||||
|
||||
// Save file type
|
||||
if let Ok(file_type) = self.get_magic_result(CookieFlags::empty()) {
|
||||
if !file_type.is_empty() {
|
||||
let _ = output_metadata(conn_ref, item_id, "file_type", file_type, &self.output_names);
|
||||
}
|
||||
}
|
||||
|
||||
// Save MIME type
|
||||
// Only save MIME type since that's what's mapped in the config
|
||||
if let Ok(mime_type) = self.get_magic_result(CookieFlags::MIME_TYPE) {
|
||||
if !mime_type.is_empty() {
|
||||
let _ = output_metadata(conn_ref, item_id, "mime_type", mime_type, &self.output_names);
|
||||
}
|
||||
}
|
||||
|
||||
// Save MIME encoding
|
||||
if let Ok(mime_encoding) = self.get_magic_result(CookieFlags::MIME_ENCODING) {
|
||||
if !mime_encoding.is_empty() {
|
||||
let _ = output_metadata(conn_ref, item_id, "mime_encoding", mime_encoding, &self.output_names);
|
||||
}
|
||||
}
|
||||
|
||||
self.is_saved = true;
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user