fix: remove saved_during_io from trait and add to BinaryMetaPlugin
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -74,12 +74,25 @@ impl MetaPlugin for BinaryMetaPlugin {
|
||||
self.meta_name.clone()
|
||||
}
|
||||
|
||||
fn initialize(&mut self, conn: &Connection, item_id: i64) -> Result<()> {
|
||||
fn initialize(&mut self, conn: &Connection, item_id: i64) -> Result<()> {
|
||||
self.item_id = Some(item_id);
|
||||
// Store raw pointer to connection - unsafe but necessary for this design
|
||||
self.conn = Some(conn as *const _ as *mut Connection);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn save_meta(&mut self, conn: &Connection, item_id: i64, value: String) -> Result<()> {
|
||||
let meta_name = self.meta_name();
|
||||
debug!("Saving metadata: item_id={}, name={}, value={}", item_id, meta_name, value);
|
||||
let meta = crate::db::Meta {
|
||||
id: item_id,
|
||||
name: meta_name,
|
||||
value,
|
||||
};
|
||||
crate::db::store_meta(conn, meta)?;
|
||||
self.saved_during_io = true;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl CwdMetaPlugin {
|
||||
|
||||
Reference in New Issue
Block a user