From efd35de67f6700ecf4f49a87d310d99cefbaa328 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 30 May 2021 12:15:07 -0400 Subject: 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 --- ext/js/background/backend.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'ext/js/background/backend.js') 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 -- cgit v1.2.3