merged mode: support {audio} marker (first term)

This commit is contained in:
siikamiika 2017-10-17 17:57:44 +03:00
parent 81f0a61651
commit c1c851d781

View File

@ -140,8 +140,13 @@ async function audioInject(definition, fields, mode) {
}
try {
const url = await audioBuildUrl(definition, mode);
const filename = audioBuildFilename(definition);
let audioSourceDefinition = definition;
if (definition.hasOwnProperty('expressions')) {
audioSourceDefinition = definition.expressions[0];
}
const url = await audioBuildUrl(audioSourceDefinition, mode);
const filename = audioBuildFilename(audioSourceDefinition);
if (url && filename) {
definition.audio = {url, filename};