feat: Use the generic note retrieval anki service function in a:c:l

This commit is contained in:
Dendy 2025-10-05 08:42:55 +02:00
parent 5fa099bfe1
commit c8278b506a
2 changed files with 3 additions and 22 deletions

View File

@ -89,30 +89,10 @@ class CreateProductionCommand extends Command
}
}
/** @return list<SentenceNote> */
private function getAllSentenceNotes(): array
{
printf('Getting all SentenceNote...');
$allIds = $this->ankiService->getAllSentenceNoteIds();
$allNotes = $this->ankiService->getNotes($allIds);
printf(" OK (%d)\n", count($allNotes));
return $allNotes;
}
/** @return list<SentenceListeningNote> */
private function getAllSentenceListeningNotes(): array
{
printf('Getting all SentenceListeningNote...');
$allListeningIds = $this->ankiService->getAllSentenceListeningNoteIds();
$allListeningNotes = $this->ankiService->getNotes($allListeningIds);
printf(" OK (%d)\n", count($allListeningNotes));
return $allListeningNotes;
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$allSentenceNotes = $this->getAllSentenceNotes();
$allListeningNotes = $this->getAllSentenceListeningNotes();
$allSentenceNotes = $this->ankiService->getAllFromClass(SentenceNote::class, false);
$allListeningNotes = $this->ankiService->getAllFromClass(SentenceListeningNote::class, false);
// Index of all the Terms indexed by its TermKanji
$allTerms = []; // ["パレートの法則" => App\Entity\Term]

View File

@ -5,6 +5,7 @@ namespace App\Entity;
class SentenceNote extends Note
{
const MODEL_NAME = 'Japanese sentences';
const DECK = '日本語::音読';
private ?array $mediaInfo = [];
private array $terms = [];