summaryrefslogtreecommitdiff
path: root/ext/bg/js/audio.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-09 22:03:56 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-09 22:03:56 -0400
commit22b218d17238cc003938ef46403596c2183a9c1b (patch)
treef6c8158b6974ef164df394429c0058e65f8426ca /ext/bg/js/audio.js
parent8be0ddeb26ec5a7bf8d3044852754c4625a27230 (diff)
Pass optionsContext to audioBuildUrl handlers
Diffstat (limited to 'ext/bg/js/audio.js')
-rw-r--r--ext/bg/js/audio.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js
index de4e80f3..36ce03cf 100644
--- a/ext/bg/js/audio.js
+++ b/ext/bg/js/audio.js
@@ -88,7 +88,7 @@ const audioUrlBuilders = {
}
};
-async function audioBuildUrl(definition, mode, cache={}) {
+async function audioBuildUrl(definition, mode, optionsContext, cache={}) {
const cacheKey = `${mode}:${definition.expression}`;
if (cache.hasOwnProperty(cacheKey)) {
return Promise.resolve(cache[cacheKey]);
@@ -96,7 +96,7 @@ async function audioBuildUrl(definition, mode, cache={}) {
if (audioUrlBuilders.hasOwnProperty(mode)) {
const handler = audioUrlBuilders[mode];
- return handler(definition).then(
+ return handler(definition, optionsContext).then(
(url) => {
cache[cacheKey] = url;
return url;
@@ -138,7 +138,7 @@ function audioBuildFilename(definition) {
}
}
-async function audioInject(definition, fields, mode) {
+async function audioInject(definition, fields, mode, optionsContext) {
let usesAudio = false;
for (const name in fields) {
if (fields[name].includes('{audio}')) {
@@ -157,7 +157,7 @@ async function audioInject(definition, fields, mode) {
audioSourceDefinition = definition.expressions[0];
}
- const url = await audioBuildUrl(audioSourceDefinition, mode);
+ const url = await audioBuildUrl(audioSourceDefinition, mode, optionsContext);
const filename = audioBuildFilename(audioSourceDefinition);
if (url && filename) {