feat: Use the generic note retrieval anki service function in a:c:l
This commit is contained in:
parent
5fa099bfe1
commit
c8278b506a
|
@ -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
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$allSentenceNotes = $this->getAllSentenceNotes();
|
$allSentenceNotes = $this->ankiService->getAllFromClass(SentenceNote::class, false);
|
||||||
$allListeningNotes = $this->getAllSentenceListeningNotes();
|
$allListeningNotes = $this->ankiService->getAllFromClass(SentenceListeningNote::class, false);
|
||||||
|
|
||||||
// Index of all the Terms indexed by its TermKanji
|
// Index of all the Terms indexed by its TermKanji
|
||||||
$allTerms = []; // ["パレートの法則" => App\Entity\Term]
|
$allTerms = []; // ["パレートの法則" => App\Entity\Term]
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace App\Entity;
|
||||||
class SentenceNote extends Note
|
class SentenceNote extends Note
|
||||||
{
|
{
|
||||||
const MODEL_NAME = 'Japanese sentences';
|
const MODEL_NAME = 'Japanese sentences';
|
||||||
|
const DECK = '日本語::音読';
|
||||||
|
|
||||||
private ?array $mediaInfo = [];
|
private ?array $mediaInfo = [];
|
||||||
private array $terms = [];
|
private array $terms = [];
|
||||||
|
|
Loading…
Reference in New Issue