aboutsummaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-05-30 12:15:07 -0400
committerGitHub <noreply@github.com>2021-05-30 12:15:07 -0400
commitefd35de67f6700ecf4f49a87d310d99cefbaa328 (patch)
treeb031d5c24b3e118efb868bf1b098bb10cf3b2c3e /ext/js/background/backend.js
parent0f0e80aadb97c95d307dcd97edabd2087d0a1743 (diff)
Refactor display audio options (#1717)
* Update how options are updated and stored in DisplayAudio * Add source list * Improve menus for custom json * Clear cache after options update * Move function * Update public API * Simplify playing audio from a specific source * Simplify audio list * Refactor audio source usage * Refactoring * Refactor argument names * Fix incorrect source usage * Remove unused * Remove return value * Simplify details * Simplify Anki card audio details * Update the data that is passed to AudioDownloader * Simplify schema handling * Remove unnecessary details
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js14
1 files changed, 4 insertions, 10 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index ba310d93..42b03c59 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -519,8 +519,8 @@ class Backend {
return this._runCommand(command, params);
}
- async _onApiGetTermAudioInfoList({source, term, reading, details}) {
- return await this._audioDownloader.getTermAudioInfoList(source, term, reading, details);
+ async _onApiGetTermAudioInfoList({source, term, reading}) {
+ return await this._audioDownloader.getTermAudioInfoList(source, term, reading);
}
_onApiSendMessageToFrame({frameId: targetFrameId, action, params}, sender) {
@@ -1742,7 +1742,7 @@ class Backend {
return null;
}
- const {sources, preferredAudioIndex, customSourceUrl} = details;
+ const {sources, preferredAudioIndex} = details;
let data;
let contentType;
try {
@@ -1750,13 +1750,7 @@ class Backend {
sources,
preferredAudioIndex,
term,
- reading,
- {
- textToSpeechVoice: null,
- customSourceUrl,
- binary: true,
- disableCache: true
- }
+ reading
));
} catch (e) {
// No audio