Added nextReviews field to cardsInfo, (similar to guiCurrentCard)

This commit is contained in:
jay-lee-code 2024-06-08 16:29:17 -07:00 committed by Alex Yatskov
parent 306103c618
commit 7c171d6722

View File

@ -1535,6 +1535,8 @@ class AnkiConnect:
order = info['ord'] order = info['ord']
name = info['name'] name = info['name']
fields[name] = {'value': note.fields[order], 'order': order} fields[name] = {'value': note.fields[order], 'order': order}
states = self.collection()._backend.get_scheduling_states(card.id)
nextReviews = self.collection()._backend.describe_next_states(states)
result.append({ result.append({
'cardId': card.id, 'cardId': card.id,
@ -1558,6 +1560,7 @@ class AnkiConnect:
'lapses': card.lapses, 'lapses': card.lapses,
'left': card.left, 'left': card.left,
'mod': card.mod, 'mod': card.mod,
'nextReviews': list(nextReviews),
}) })
except NotFoundError: except NotFoundError:
# Anki will give a NotFoundError if the card ID does not exist. # Anki will give a NotFoundError if the card ID does not exist.