feat: update metadata field names to use mime_type and mime_encoding
This commit is contained in:
committed by
Andrew Phillips (aider)
parent
18a3f1b36e
commit
05b2c1b9bd
@@ -505,7 +505,7 @@ async fn get_item_raw_content(item: &db::Item, data_dir: &PathBuf, conn: &mut ru
|
||||
|
||||
let mime_type = meta_entries
|
||||
.iter()
|
||||
.find(|m| m.name == "file.mime")
|
||||
.find(|m| m.name == "mime_type")
|
||||
.map(|m| m.value.clone())
|
||||
.unwrap_or_else(|| "application/octet-stream".to_string());
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ pub struct ItemInfo {
|
||||
pub compression: String,
|
||||
#[schema(example = json!(["important", "work", "document"]))]
|
||||
pub tags: Vec<String>,
|
||||
#[schema(example = json!({"file.mime": "text/plain", "file.encoding": "utf-8", "line_count": "42"}))]
|
||||
#[schema(example = json!({"mime_type": "text/plain", "mime_encoding": "utf-8", "line_count": "42"}))]
|
||||
pub metadata: HashMap<String, String>,
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ pub struct ItemInfo {
|
||||
#[schema(description = "Item information including content and metadata, with binary detection")]
|
||||
pub struct ItemContentInfo {
|
||||
#[serde(flatten)]
|
||||
#[schema(example = json!({"file.mime": "text/plain", "file.encoding": "utf-8", "line_count": "42"}))]
|
||||
#[schema(example = json!({"mime_type": "text/plain", "mime_encoding": "utf-8", "line_count": "42"}))]
|
||||
pub metadata: HashMap<String, String>,
|
||||
#[schema(example = "Hello, world!\nThis is the content of the file.")]
|
||||
pub content: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user