fix: Do update the terms correctly (oops)

This commit is contained in:
Dendy 2025-02-09 13:29:06 +09:00
parent 0ac5d035a2
commit 64d5381d1e
1 changed files with 2 additions and 4 deletions

View File

@ -67,10 +67,10 @@ class Note
$note->mediaInfo = $note->parseMediaInfo($note->fields['Notes']); $note->mediaInfo = $note->parseMediaInfo($note->fields['Notes']);
// Set VocabKanji field // Set VocabKanji field
$terms = Term::fromNoteFields($note->fields); $note->terms = Term::fromNoteFields($note->fields);
// If not defined, find them from the highlighted parts in the sentence // If not defined, find them from the highlighted parts in the sentence
if (empty($terms)) { if (empty($note->terms)) {
// 1. Get all spans in the text // 1. Get all spans in the text
preg_match_all( preg_match_all(
self::HIGHLIGHT_PATTERN, self::HIGHLIGHT_PATTERN,
@ -90,8 +90,6 @@ class Note
} }
} }
if (empty($terms)) dd($note);
// Set to null whatever is null // Set to null whatever is null
$readings = array_map( $readings = array_map(
fn($x) => in_array($x, ['_', '_', '']) ? null : $x, fn($x) => in_array($x, ['_', '_', '']) ? null : $x,