mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Return current weights if fsrs items is zero & handle error in evaluation and optimal retention (#3141)
* return current weights if fsrs_items is zero * handle error of evaluation if items.is_empty() * TODO: handle error of optimal retention * Revert "TODO: handle error of optimal retention" This reverts commit80a5b3803e
. * Revert "handle error of evaluation if items.is_empty()" This reverts commit7f0a5570e7
.
This commit is contained in:
parent
e66adcca38
commit
d1b2ab5983
1 changed files with 6 additions and 0 deletions
|
@ -65,6 +65,12 @@ impl Collection {
|
|||
fsrs_items_for_training(revlogs.clone(), timing.next_day_at, ignore_revlogs_before);
|
||||
|
||||
let fsrs_items = items.len() as u32;
|
||||
if fsrs_items == 0 {
|
||||
return Ok(ComputeFsrsWeightsResponse {
|
||||
weights: current_weights.to_vec(),
|
||||
fsrs_items,
|
||||
});
|
||||
}
|
||||
anki_progress.update(false, |p| {
|
||||
p.current_preset = current_preset;
|
||||
p.total_presets = total_presets;
|
||||
|
|
Loading…
Reference in a new issue