mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Fix/first and latest review dates should only consider entries with a rating. (#4360)
* Fix/first and latest review dates should only only consider entries with a rating. * Update rslib/src/stats/card.rs Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com> --------- Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
This commit is contained in:
parent
3a5a2b1afb
commit
03f3a005f4
1 changed files with 9 additions and 2 deletions
|
|
@ -76,8 +76,15 @@ impl Collection {
|
||||||
note_id: card.note_id.into(),
|
note_id: card.note_id.into(),
|
||||||
deck: deck.human_name(),
|
deck: deck.human_name(),
|
||||||
added: card.id.as_secs().0,
|
added: card.id.as_secs().0,
|
||||||
first_review: revlog.first().map(|entry| entry.id.as_secs().0),
|
first_review: revlog
|
||||||
latest_review: revlog.last().map(|entry| entry.id.as_secs().0),
|
.iter()
|
||||||
|
.find(|entry| entry.has_rating())
|
||||||
|
.map(|entry| entry.id.as_secs().0),
|
||||||
|
// last_review_time is not used to ensure cram revlogs are included.
|
||||||
|
latest_review: revlog
|
||||||
|
.iter()
|
||||||
|
.rfind(|entry| entry.has_rating())
|
||||||
|
.map(|entry| entry.id.as_secs().0),
|
||||||
due_date: self.due_date(&card)?,
|
due_date: self.due_date(&card)?,
|
||||||
due_position: self.position(&card),
|
due_position: self.position(&card),
|
||||||
interval: card.interval,
|
interval: card.interval,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue