summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-07 14:11:28 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-07 21:43:51 -0500
commit6adf2cf63f3f67020d3d06adfdfa0f136a7e09e0 (patch)
treecee0093aa1d3ee7e3db177fc42c6da372b113888 /ext
parenta8eb50d96f50ae20033ccc05094caaedbae81936 (diff)
Rename function
Diffstat (limited to 'ext')
-rw-r--r--ext/bg/js/audio.js2
-rw-r--r--ext/mixed/js/audio.js8
-rw-r--r--ext/mixed/js/display.js2
3 files changed, 6 insertions, 6 deletions
diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js
index 3bcfc4e7..c94121ae 100644
--- a/ext/bg/js/audio.js
+++ b/ext/bg/js/audio.js
@@ -171,7 +171,7 @@ async function audioInject(definition, fields, sources, optionsContext, audioSys
const expressions = definition.expressions;
const audioSourceDefinition = Array.isArray(expressions) ? expressions[0] : definition;
- const {uri} = await audioSystem.getExpressionAudio(audioSourceDefinition, sources, {tts: false, optionsContext});
+ const {uri} = await audioSystem.getDefinitionAudio(audioSourceDefinition, sources, {tts: false, optionsContext});
const filename = audioBuildFilename(audioSourceDefinition);
if (filename !== null) {
definition.audio = {url: uri, filename};
diff --git a/ext/mixed/js/audio.js b/ext/mixed/js/audio.js
index 1da5d48c..31c476b1 100644
--- a/ext/mixed/js/audio.js
+++ b/ext/mixed/js/audio.js
@@ -78,16 +78,16 @@ class AudioSystem {
}
}
- async getExpressionAudio(expression, sources, details) {
- const key = `${expression.expression}:${expression.reading}`;
- const cacheValue = this._cache.get(expression);
+ async getDefinitionAudio(definition, sources, details) {
+ const key = `${definition.expression}:${definition.reading}`;
+ const cacheValue = this._cache.get(definition);
if (typeof cacheValue !== 'undefined') {
const {audio, uri, source} = cacheValue;
return {audio, uri, source};
}
for (const source of sources) {
- const uri = await this._getAudioUri(expression, source, details);
+ const uri = await this._getAudioUri(definition, source, details);
if (uri === null) { continue; }
try {
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 9d2746fd..3fe8e684 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -775,7 +775,7 @@ class Display {
const sources = this.options.audio.sources;
let audio, source, info;
try {
- ({audio, source} = await this.audioSystem.getExpressionAudio(expression, sources));
+ ({audio, source} = await this.audioSystem.getDefinitionAudio(expression, sources));
info = `From source ${1 + sources.indexOf(source)}: ${source}`;
} catch (e) {
if (this.audioFallback === null) {