fix: correct metadata access in get mode to use proper DB function

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-11 13:16:45 -03:00
parent 40f07b6915
commit ab7dc4c34f

View File

@@ -45,8 +45,10 @@ pub fn mode_get(
// Check if this is a binary item and we're outputting to a TTY
if !args.options.force {
if let Some(binary_meta) = item.meta.get("binary") {
if binary_meta == "true" {
let item_meta = crate::db::get_item_meta(conn, &item)?;
let binary_meta = item_meta.into_iter().find(|meta| meta.name == "binary");
if let Some(binary_meta) = binary_meta {
if binary_meta.value == "true" {
if is_stdout_tty() {
return Err(anyhow!("Refusing to output binary data to TTY, use --force to override"));
}