diff options
Diffstat (limited to 'ext/js/data/options-util.js')
-rw-r--r-- | ext/js/data/options-util.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 857ef630..42f9a38f 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -791,12 +791,20 @@ class OptionsUtil { _updateVersion11(options) { // Version 11 changes: // Changed dictionaries to an array. + // Changed audio.customSourceUrl's {expression} marker to {term}. + const customSourceUrlPattern = /\{expression\}/g; for (const profile of options.profiles) { const dictionariesNew = []; for (const [name, {priority, enabled, allowSecondarySearches, definitionsCollapsible}] of Object.entries(profile.options.dictionaries)) { dictionariesNew.push({name, priority, enabled, allowSecondarySearches, definitionsCollapsible}); } profile.options.dictionaries = dictionariesNew; + + let {customSourceUrl} = profile.options.audio; + if (typeof customSourceUrl === 'string') { + customSourceUrl = customSourceUrl.replace(customSourceUrlPattern, '{term}'); + } + profile.options.audio.customSourceUrl = customSourceUrl; } return options; } |