diff options
Diffstat (limited to 'ext/bg/js/audio.js')
-rw-r--r-- | ext/bg/js/audio.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/bg/js/audio.js b/ext/bg/js/audio.js index 0bf836df..9e0ae67c 100644 --- a/ext/bg/js/audio.js +++ b/ext/bg/js/audio.js @@ -85,6 +85,11 @@ const audioUrlBuilders = { } throw new Error('Failed to find audio URL'); + }, + 'custom': async (definition, optionsContext) => { + const options = await apiOptionsGet(optionsContext); + const customSourceUrl = options.audio.customSourceUrl; + return customSourceUrl.replace(/\{([^\}]*)\}/g, (m0, m1) => (definition.hasOwnProperty(m1) ? `${definition[m1]}` : m0)); } }; |