fix: If no note is found with that vocab in SentKanji, look for VocabKanji
This commit is contained in:
parent
1ff04811cb
commit
0eab07c497
|
@ -71,6 +71,15 @@ class CreateProductionCommand extends Command
|
||||||
$term->getKanji(),
|
$term->getKanji(),
|
||||||
SentenceNote::MODEL_NAME,
|
SentenceNote::MODEL_NAME,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
if (count($noteIds) <= 0) {
|
||||||
|
$noteIds = $this->ankiService->findNotesIds(sprintf(
|
||||||
|
'"VocabKanji:*%s*" "note:%s"',
|
||||||
|
$term->getKanji(),
|
||||||
|
SentenceNote::MODEL_NAME,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
$sNote = $this->ankiService->getNote($noteIds[array_key_last($noteIds)]);
|
$sNote = $this->ankiService->getNote($noteIds[array_key_last($noteIds)]);
|
||||||
|
|
||||||
$newSlNote = SentenceListeningNote::fromNote($sNote, $term);
|
$newSlNote = SentenceListeningNote::fromNote($sNote, $term);
|
||||||
|
|
Loading…
Reference in New Issue