mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix/ignore revlogs when there is not learn entry after the last forget entry (#3199)
This commit is contained in:
parent
70996146d2
commit
2b890b0eee
1 changed files with 11 additions and 6 deletions
|
@ -239,15 +239,20 @@ pub(crate) fn single_card_revlog_to_items(
|
||||||
revlogs_complete = true;
|
revlogs_complete = true;
|
||||||
} else if first_of_last_learn_entries.is_some() {
|
} else if first_of_last_learn_entries.is_some() {
|
||||||
break;
|
break;
|
||||||
// if we find the `Forget` entry before the `Learn` entry, we should
|
|
||||||
// ignore all the entries
|
|
||||||
} else if matches!(
|
} else if matches!(
|
||||||
(entry.review_kind, entry.ease_factor),
|
(entry.review_kind, entry.ease_factor),
|
||||||
(RevlogReviewKind::Manual, 0)
|
(RevlogReviewKind::Manual, 0)
|
||||||
) && first_of_last_learn_entries.is_none()
|
) {
|
||||||
{
|
// If we find a `Learn` entry after the `Forget` entry, we should
|
||||||
|
// ignore the entries before the `Forget` entry
|
||||||
|
if first_of_last_learn_entries.is_some() {
|
||||||
revlogs_complete = false;
|
revlogs_complete = false;
|
||||||
break;
|
break;
|
||||||
|
// If we don't find a `Learn` entry after the `Forget` entry, it's
|
||||||
|
// a new card and we should ignore all entries
|
||||||
|
} else {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !revlogs_complete {
|
if !revlogs_complete {
|
||||||
|
|
Loading…
Reference in a new issue