Fix definitionDetails using expression instead of term (#1562)
This commit is contained in:
parent
90f7d5ba07
commit
299720d799
@ -1717,12 +1717,12 @@ class Backend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _injectAnkNoteAudio(ankiConnect, timestamp, definitionDetails, details) {
|
async _injectAnkNoteAudio(ankiConnect, timestamp, definitionDetails, details) {
|
||||||
const {type, expression, reading} = definitionDetails;
|
const {type, term, reading} = definitionDetails;
|
||||||
if (
|
if (
|
||||||
type === 'kanji' ||
|
type === 'kanji' ||
|
||||||
typeof expression !== 'string' ||
|
typeof term !== 'string' ||
|
||||||
typeof reading !== 'string' ||
|
typeof reading !== 'string' ||
|
||||||
(expression.length === 0 && reading.length === 0)
|
(term.length === 0 && reading.length === 0)
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -1734,7 +1734,7 @@ class Backend {
|
|||||||
({data, contentType} = await this._audioDownloader.downloadExpressionAudio(
|
({data, contentType} = await this._audioDownloader.downloadExpressionAudio(
|
||||||
sources,
|
sources,
|
||||||
preferredAudioIndex,
|
preferredAudioIndex,
|
||||||
expression,
|
term,
|
||||||
reading,
|
reading,
|
||||||
{
|
{
|
||||||
textToSpeechVoice: null,
|
textToSpeechVoice: null,
|
||||||
@ -1804,9 +1804,9 @@ class Backend {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
const {reading, expression} = definitionDetails;
|
const {reading, term} = definitionDetails;
|
||||||
if (reading) { fileName += `_${reading}`; }
|
if (reading) { fileName += `_${reading}`; }
|
||||||
if (expression) { fileName += `_${expression}`; }
|
if (term) { fileName += `_${term}`; }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user