feat: rename magic meta fields to remove prefix
This commit is contained in:
committed by
Andrew Phillips (aider)
parent
1b6ff44312
commit
e86fbda144
@@ -62,7 +62,7 @@ impl MagicFileMetaPlugin {
|
|||||||
if !file_type.is_empty() {
|
if !file_type.is_empty() {
|
||||||
let meta = crate::db::Meta {
|
let meta = crate::db::Meta {
|
||||||
id: item_id,
|
id: item_id,
|
||||||
name: "magic_file_type".to_string(),
|
name: "file_type".to_string(),
|
||||||
value: file_type,
|
value: file_type,
|
||||||
};
|
};
|
||||||
let _ = crate::db::store_meta(conn_ref, meta);
|
let _ = crate::db::store_meta(conn_ref, meta);
|
||||||
@@ -74,7 +74,7 @@ impl MagicFileMetaPlugin {
|
|||||||
if !mime_type.is_empty() {
|
if !mime_type.is_empty() {
|
||||||
let meta = crate::db::Meta {
|
let meta = crate::db::Meta {
|
||||||
id: item_id,
|
id: item_id,
|
||||||
name: "magic_mime_type".to_string(),
|
name: "mime_type".to_string(),
|
||||||
value: mime_type,
|
value: mime_type,
|
||||||
};
|
};
|
||||||
let _ = crate::db::store_meta(conn_ref, meta);
|
let _ = crate::db::store_meta(conn_ref, meta);
|
||||||
@@ -86,25 +86,13 @@ impl MagicFileMetaPlugin {
|
|||||||
if !mime_encoding.is_empty() {
|
if !mime_encoding.is_empty() {
|
||||||
let meta = crate::db::Meta {
|
let meta = crate::db::Meta {
|
||||||
id: item_id,
|
id: item_id,
|
||||||
name: "magic_mime_encoding".to_string(),
|
name: "mime_encoding".to_string(),
|
||||||
value: mime_encoding,
|
value: mime_encoding,
|
||||||
};
|
};
|
||||||
let _ = crate::db::store_meta(conn_ref, meta);
|
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;
|
self.is_saved = true;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user