diff --git a/src/Service/AnkiService.php b/src/Service/AnkiService.php index f33cef9..87ffaf6 100644 --- a/src/Service/AnkiService.php +++ b/src/Service/AnkiService.php @@ -58,14 +58,17 @@ class AnkiService return $this->getNotesInfo([$noteId])[0]; } + public function getNote(int $nid): ?Note + { + return Note::fromAnki($this->getNoteInfo($nid)); + } + public function getLatestNote(): ?Note { // NoteIDs are just timestamps in milliseconds, so the latest is just // the biggest numerically $latestId = max($this->getAllNoteIds()); - $noteInfo = $this->getNoteInfo($latestId); - - return Note::fromAnki($noteInfo); + return $this->getNote($latestId); } public function updateNote(Note $note)