coerce some more invalid decimal values to ints during sync

This commit is contained in:
Damien Elmes 2021-01-25 09:38:07 +10:00
parent 370fc00afd
commit ef9f6b022b
2 changed files with 4 additions and 2 deletions

View file

@ -2,8 +2,8 @@ SELECT id,
cid,
usn,
ease,
ivl,
lastIvl,
cast(ivl AS integer),
cast(lastIvl AS integer),
factor,
time,
type

View file

@ -147,6 +147,7 @@ pub struct CardEntry {
pub usn: Usn,
pub ctype: CardType,
pub queue: CardQueue,
#[serde(deserialize_with = "deserialize_int_from_number")]
pub due: i32,
#[serde(deserialize_with = "deserialize_int_from_number")]
pub ivl: u32,
@ -154,6 +155,7 @@ pub struct CardEntry {
pub reps: u32,
pub lapses: u32,
pub left: u32,
#[serde(deserialize_with = "deserialize_int_from_number")]
pub odue: i32,
pub odid: DeckID,
pub flags: u8,