Fix error after notetype merge + downgrade

This commit is contained in:
Damien Elmes 2024-01-12 15:16:27 +10:00
parent 4ccb814fb3
commit f21b5aec12
2 changed files with 3 additions and 2 deletions

View File

@ -186,6 +186,7 @@ static RESERVED_NOTETYPE_KEYS: Set<&'static str> = phf_set! {
"flds",
"css",
"originalStockKind",
"originalId",
"id",
"usn",
"mod",

View File

@ -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<HashMap<NotetypeId, NotetypeSchema11>> {
let v: HashMap<NotetypeId, NotetypeSchema11> =
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()