diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-05-30 12:41:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-30 12:41:19 -0400 |
commit | cca01e85a35576225661699a7be63550e9500642 (patch) | |
tree | de52f621afa61afd6df2fdc6c91286e9247574ff /ext/js/pages/settings/backup-controller.js | |
parent | efd35de67f6700ecf4f49a87d310d99cefbaa328 (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/pages/settings/backup-controller.js')
-rw-r--r-- | ext/js/pages/settings/backup-controller.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js index c961d40e..02ad368c 100644 --- a/ext/js/pages/settings/backup-controller.js +++ b/ext/js/pages/settings/backup-controller.js @@ -278,11 +278,18 @@ class BackupController { const audio = options.audio; if (isObject(audio)) { - const customSourceUrl = audio.customSourceUrl; - if (typeof customSourceUrl === 'string' && customSourceUrl.length > 0 && !this._isLocalhostUrl(customSourceUrl)) { - warnings.push('audio.customSourceUrl uses a non-localhost URL'); - if (!dryRun) { - audio.customSourceUrl = ''; + const sources = audio.sources; + if (Array.isArray(sources)) { + for (let i = 0, ii = sources.length; i < ii; ++i) { + const source = sources[i]; + if (!isObject(source)) { continue; } + const {url} = source; + if (typeof url === 'string' && url.length > 0 && !this._isLocalhostUrl(url)) { + warnings.push(`audio.sources[${i}].url uses a non-localhost URL`); + if (!dryRun) { + sources[i].url = ''; + } + } } } } |