mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Make simulator fill missing values of DR and decay too
If a card has missing memory states, it will likely have missing DR and decay too. So, it makes sense to simultaneously update them as well.
This commit is contained in:
parent
f3b4284afb
commit
60a1f0ab80
1 changed files with 4 additions and 2 deletions
|
@ -143,8 +143,10 @@ impl Collection {
|
||||||
for c in &mut cards {
|
for c in &mut cards {
|
||||||
if is_included_card(c) && c.memory_state.is_none() {
|
if is_included_card(c) && c.memory_state.is_none() {
|
||||||
let original = c.clone();
|
let original = c.clone();
|
||||||
let new_state = self.compute_memory_state(c.id)?.state;
|
let fsrs_data = self.compute_memory_state(c.id)?;
|
||||||
c.memory_state = new_state.map(Into::into);
|
c.memory_state = fsrs_data.state.map(Into::into);
|
||||||
|
c.desired_retention = fsrs_data.desired_retention;
|
||||||
|
c.decay = fsrs_data.decay;
|
||||||
self.update_card_inner(c, original, self.usn()?)?;
|
self.update_card_inner(c, original, self.usn()?)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue