CardContentProvider was expanded to add two endpoints for cards:
But additional fields were deferred, due to API design concerns.
// docs trimmed, see https://github.com/ankidroid/Anki-Android/issues/20112
public const val DUE: String = "due"
public const val INTERVAL: String = "interval"
public const val EASE_FACTOR: String = "ease_factor"
public const val REVIEWS: String = "reviews"
// there are more fields which the above issue did not handle
Due to my comment:
I'd strongly suggest splitting this PR into two parts:
- Adding the public /cards/ endpoints: easy
- Adding additional properties to /cards: harder
Specifically for (2), I would like to see the source/docs of upstream Anki Desktop AnkiConnect, and how the data is modelled there. This is how people are used to consuming our data.
#20175 (review)
The state of FSRS determines whether some properties for a card are valid or not (Ease = SM-2; Difficulty: FSRS)
Some properties had rather complex logic which we likley want to abstract in a more user-friendly manner:
due integer not null,
-- Due is used differently for different card types:
-- new: the order in which cards are to be studied; starts from 1.
-- learning/relearning: epoch timestamp in seconds
-- review: days since the collection's creation time
-- For cards in filtered decks, due represents the position of the card in the filtered deck. The value of due before moving to the filtered deck is saved as odue.
ivl integer not null,
-- The interval of the card in days.
-- For learning cards, it is 0.
-- For relearning cards, it is the interval (in days) that the card will get after passing through all the steps.
-- https://github.com/ankidroid/Anki-Android/wiki/Database-Structure/#cards
This issue consists of three parts:
CardContentProviderwas expanded to add two endpoints for cards:/cards//cards/#But additional fields were deferred, due to API design concerns.
Due to my comment:
#20175 (review)
The state of FSRS determines whether some properties for a card are valid or not (Ease = SM-2; Difficulty: FSRS)
Some properties had rather complex logic which we likley want to abstract in a more user-friendly manner:
-- https://github.com/ankidroid/Anki-Android/wiki/Database-Structure/#cards
This issue consists of three parts:
Card.ktand list the properties which are available