Fix/first and latest review dates should only only consider entries with a rating.

This commit is contained in:
Jarrett Ye 2025-09-23 22:15:34 +08:00
parent 04a0b10a15
commit b0990c102c

View file

@ -76,8 +76,14 @@ 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),
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,