summaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-07 14:36:16 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-03-07 21:57:26 -0500
commit391f3dd29af2017b540b38e67a06242af85268ba (patch)
tree5ad1f7087d8acf61ba1af33d03ba89776e72cc06 /ext/bg/js/backend.js
parent21d194d14510abb149d22c8cbd56570cd6b62266 (diff)
Update how audio URIs are built
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 1fdc4c70..66378b0c 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -21,9 +21,8 @@ conditionsTestValue, profileConditionsDescriptor
handlebarsRenderDynamic
requestText, requestJson, optionsLoad
dictConfigured, dictTermsSort, dictEnabledSet
-audioGetUrl
jpConvertReading, jpDistributeFuriganaInflected, jpKatakanaToHiragana
-AnkiNoteBuilder, AudioSystem, Translator, AnkiConnect, AnkiNull, Mecab, BackendApiForwarder, JsonSchema, ClipboardMonitor*/
+AnkiNoteBuilder, AudioSystem, AudioUriBuilder, Translator, AnkiConnect, AnkiNull, Mecab, BackendApiForwarder, JsonSchema, ClipboardMonitor*/
class Backend {
constructor() {
@@ -36,6 +35,7 @@ class Backend {
this.optionsSchema = null;
this.defaultAnkiFieldTemplates = null;
this.audioSystem = new AudioSystem({getAudioUri: this._getAudioUri.bind(this)});
+ this.audioUriBuilder = new AudioUriBuilder();
this.optionsContext = {
depth: 0,
url: window.location.href
@@ -515,7 +515,7 @@ class Backend {
async _onApiAudioGetUrl({definition, source, optionsContext}) {
const options = this.getOptions(optionsContext);
- return await audioGetUrl(definition, source, options);
+ return await this.audioUriBuilder.getUri(source, definition, options);
}
_onApiScreenshotGet({options}, sender) {
@@ -771,7 +771,7 @@ class Backend {
}
const options = this.getOptions(optionsContext);
- return await audioGetUrl(definition, source, options);
+ return await this.audioUriBuilder.getUri(source, definition, options);
}
async _audioInject(definition, fields, sources, optionsContext) {