Anki adds last_review_time to card data

Background

Anki’s method for determining the last review time has two main issues:

  • Performance: Querying the revlog is slow for batch operations.
  • Accuracy: Estimations based on due and interval fields can be incorrect, especially when modified manually or by add-ons.

Key Changes

  • Schema Update:
    • Added last_review_time_secs (optional int64) to the protobuf definition.
  • Data Structures:
    • Introduced last_review_time: Option<TimestampSecs> to the Rust Card struct.
  • Serialization:
    • Integrated last_review_time into read/write logic.
  • Review Logic:
    • Updated to store exact timestamp during card reviews.
  • Calculation Logic:
    • Functions now prioritize last_review_time over legacy methods.

Affected Components

  • Card protobuf and Rust data structures
  • Serialization/deserialization
  • Browser table and scheduling logic
  • Statistics
  • Sync functionality

Benefits

  • Improved Performance: Avoids costly revlog queries.
  • Better Accuracy: Captures actual review timestamp.
  • Backward Compatibility: Falls back to older methods if the new field is absent.
,

Leave a comment

Discover more from /root

Subscribe now to keep reading and get access to the full archive.

Continue reading