diff --git a/rslib/src/notetype/schema11.rs b/rslib/src/notetype/schema11.rs index 044c405ef..272456ab7 100644 --- a/rslib/src/notetype/schema11.rs +++ b/rslib/src/notetype/schema11.rs @@ -186,6 +186,7 @@ static RESERVED_NOTETYPE_KEYS: Set<&'static str> = phf_set! { "flds", "css", "originalStockKind", + "originalId", "id", "usn", "mod", diff --git a/rslib/src/storage/notetype/mod.rs b/rslib/src/storage/notetype/mod.rs index b664ffc16..88c4074ac 100644 --- a/rslib/src/storage/notetype/mod.rs +++ b/rslib/src/storage/notetype/mod.rs @@ -345,7 +345,7 @@ impl SqliteStorage { let nts = self .get_schema11_notetypes() .map_err(|e| AnkiError::JsonError { - info: format!("decoding models: {}", e), + info: format!("decoding models: {:?}", e), })?; let mut names = HashSet::new(); for (mut ntid, nt) in nts { @@ -383,7 +383,7 @@ impl SqliteStorage { let notetypes = stmt .query_and_then([], |row| -> Result> { let v: HashMap = - serde_json::from_str(row.get_ref_unwrap(0).as_str()?)?; + serde_json::from_value(serde_json::from_str(row.get_ref_unwrap(0).as_str()?)?)?; Ok(v) })? .next()