Implement custom audio source

This commit is contained in:
toasted-nutbread 2019-10-10 20:17:01 -04:00
parent 50252ec627
commit 27c8430915

View File

@ -85,6 +85,11 @@ const audioUrlBuilders = {
} }
throw new Error('Failed to find audio URL'); 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));
} }
}; };