aboutsummaryrefslogtreecommitdiff
path: root/ext/js/data
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-05-30 12:41:19 -0400
committerGitHub <noreply@github.com>2021-05-30 12:41:19 -0400
commitcca01e85a35576225661699a7be63550e9500642 (patch)
treede52f621afa61afd6df2fdc6c91286e9247574ff /ext/js/data
parentefd35de67f6700ecf4f49a87d310d99cefbaa328 (diff)
Improve multiple audio sources (#1718)
* Add url/voice options to audio sources * Add help for TTS * Remove old settings * Update tests * Update use of audio source URL * Improve labels for sources with the same type
Diffstat (limited to 'ext/js/data')
-rw-r--r--ext/js/data/options-util.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js
index 89d50903..eb29dae4 100644
--- a/ext/js/data/options-util.js
+++ b/ext/js/data/options-util.js
@@ -826,16 +826,21 @@ class OptionsUtil {
sentenceParsing.terminationCharacterMode = sentenceParsing.enableTerminationCharacters ? 'custom' : 'newlines';
delete sentenceParsing.enableTerminationCharacters;
- const {sources, customSourceType} = audio;
+ const {sources, customSourceUrl, customSourceType, textToSpeechVoice} = audio;
audio.sources = sources.map((type) => {
switch (type) {
+ case 'text-to-speech':
+ case 'text-to-speech-reading':
+ return {type, url: '', voice: textToSpeechVoice};
case 'custom':
- return (customSourceType === 'json' ? 'custom-json' : 'custom');
+ return {type: (customSourceType === 'json' ? 'custom-json' : 'custom'), url: customSourceUrl, voice: ''};
default:
- return type;
+ return {type, url: '', voice: ''};
}
});
delete audio.customSourceType;
+ delete audio.customSourceUrl;
+ delete audio.textToSpeechVoice;
}
return options;
}