aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-15 20:47:35 -0500
committerGitHub <noreply@github.com>2021-02-15 20:47:35 -0500
commitf2a387237bac02d93d1664ed7acb6a10108915b6 (patch)
tree17db44dea4a4d14ceafd73e608fd53367b0189fe /ext/js/background
parent7027d537a914cbd5a2f8aa6accf221efeed4af0d (diff)
Update audio downloading to support specifying an exact array index (#1405)
Diffstat (limited to 'ext/js/background')
-rw-r--r--ext/js/background/backend.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index d88c5853..2a3ccbc2 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -1636,10 +1636,6 @@ class Backend {
}
}
- async _downloadDefinitionAudio(sources, expression, reading, details) {
- return await this._audioDownloader.downloadExpressionAudio(sources, expression, reading, details);
- }
-
async _injectAnkNoteMedia(ankiConnect, timestamp, definitionDetails, audioDetails, screenshotDetails, clipboardDetails) {
let screenshotFileName = null;
let clipboardImageFileName = null;
@@ -1701,12 +1697,13 @@ class Backend {
return null;
}
- const {sources, customSourceUrl, customSourceType} = details;
+ const {sources, preferredAudioIndex, customSourceUrl, customSourceType} = details;
let data;
let contentType;
try {
- ({data, contentType} = await this._downloadDefinitionAudio(
+ ({data, contentType} = await this._audioDownloader.downloadExpressionAudio(
sources,
+ preferredAudioIndex,
expression,
reading,
{