revert to defaults when schema 11 deck config can not be read

Allows decks with missing/null values like ivlFct to be opened.

https://forums.ankiweb.net/t/i-cant-access-ankiweb/11814
This commit is contained in:
Damien Elmes 2021-08-02 16:27:48 +10:00
parent c6c9721c53
commit cc65196b0a

View file

@ -29,8 +29,11 @@ pub struct DeckConfSchema11 {
timer: u8,
#[serde(default)]
replayq: bool,
#[serde(deserialize_with = "default_on_invalid")]
pub(crate) new: NewConfSchema11,
#[serde(deserialize_with = "default_on_invalid")]
pub(crate) rev: RevConfSchema11,
#[serde(deserialize_with = "default_on_invalid")]
pub(crate) lapse: LapseConfSchema11,
#[serde(rename = "dyn", default, deserialize_with = "default_on_invalid")]
dynamic: bool,