summaryrefslogtreecommitdiff
path: root/ext/js/display/display-audio.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-05-26 20:38:15 -0400
committerGitHub <noreply@github.com>2021-05-26 20:38:15 -0400
commit0232325f960b1fbe41e03f74a46fb18a7abf33f7 (patch)
tree4b9552f3b0db91daab394c4047add01d32e17d44 /ext/js/display/display-audio.js
parent900bceda47e4c736e70a66e66cfce719b4c6d203 (diff)
Refactor json audio source (#1711)
* Move sources to the end of audio options object * Add custom-json audio source type * Add support for downloading custom-json * Remove customSourceType
Diffstat (limited to 'ext/js/display/display-audio.js')
-rw-r--r--ext/js/display/display-audio.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/js/display/display-audio.js b/ext/js/display/display-audio.js
index d8553547..34e74004 100644
--- a/ext/js/display/display-audio.js
+++ b/ext/js/display/display-audio.js
@@ -116,7 +116,7 @@ class DisplayAudio {
const {term, reading} = headword;
const audioOptions = this._getAudioOptions();
- const {textToSpeechVoice, customSourceUrl, customSourceType, volume} = audioOptions;
+ const {textToSpeechVoice, customSourceUrl, volume} = audioOptions;
if (!Array.isArray(sources)) {
({sources} = audioOptions);
}
@@ -131,7 +131,7 @@ class DisplayAudio {
let audio;
let title;
let source = null;
- const info = await this._createTermAudio(sources, sourceDetailsMap, term, reading, {textToSpeechVoice, customSourceUrl, customSourceType});
+ const info = await this._createTermAudio(sources, sourceDetailsMap, term, reading, {textToSpeechVoice, customSourceUrl});
const valid = (info !== null);
if (valid) {
({audio, source} = info);
@@ -518,7 +518,8 @@ class DisplayAudio {
['jisho', 'Jisho.org', true],
['text-to-speech', 'Text-to-speech', ttsSupported],
['text-to-speech-reading', 'Text-to-speech (Kana reading)', ttsSupported],
- ['custom', 'Custom', customSupported]
+ ['custom', 'Custom URL', customSupported],
+ ['custom-json', 'Custom URL (JSON)', customSupported]
];
const results = [];