#1 2020-04-24 12:47:24

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 337

Possible bug or limited feature in SynMustache

Hi @ab, I have a problem rendering mustache template:

Template

{{^context.video.main.parts}}-v error -y -i {{context.video.main.sourcefilename}} {{context.video.main.tempfilename}}.avi{{/context.video.main.parts}}
{{#context.video.main.parts}}
  {{#-first}}-v error -y -i {{context.video.main.sourcefilename}}{{/-first}}
  {{^-last}} -ss {{startoffsetinsecs}} -t {{durationinsecs}} {{tempfilename}}.avi {{/-last}}
  {{#-last}} -ss {{startoffsetinsecs}} {{tempfilename}}.avi{{/-last}}
{{/context.video.main.parts}}

Context (the context is a reduced version but same structure)

{
    "context": {
        "callrefid": "441299259001",
        "audio": {
            "main": {
                "sourcefilename": "\\TECNOVOZ\\ACD\\Vox\\20191217\\11285401.139",
                "parts": [],
                "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\A~44129925900100",
                "destfilename": "\\TecnoVoz\\Streaming\\441299259001"
            },
            "holds": []
        },
        "video": {
            "main": {
                "sourcefilename": "\\TECNOVOZ\\ACD\\Video\\20191217\\01_0139_20191217_112854_0000000000.avi",
                "parts": [{
                        "startoffsetinsecs": 0,
                        "durationinsecs": 275.333,
                        "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900101"
                    }, {
                        "startoffsetinsecs": 275.666,
                        "durationinsecs": 60.3339999999999,
                        "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900103"
                    }, {
                        "startoffsetinsecs": 1152,
                        "durationinsecs": 0,
                        "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900115"
                    }
                ],
                "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900100",
                "destfilename": "\\TecnoVoz\\Streaming\\441299259001"
            },
            "holds": [{
                    "sourcefilename": "\\TECNOVOZ\\ACD\\Video\\20191217\\01_0139_20191217_112854_0000000000_01.avi",
                    "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900102"
                }, {
                    "sourcefilename": "\\TECNOVOZ\\ACD\\Video\\20191217\\01_0139_20191217_112854_0000000000_02.avi",
                    "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900104"
                }, {
                    "sourcefilename": "\\TECNOVOZ\\ACD\\Video\\20191217\\01_0139_20191217_112854_0000000000_06.avi",
                    "tempfilename": "C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900112"
                }
            ]
        }
    }
}

Result

[context] property not found in {"startoffsetinsecs":0,"durationinsecs":275.333,"tempfilename":"C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900101"}

When debugging I see try access to "startoffsetinsecs" starting from path "context.video.main.parts" and "context" not exists in array element {"startoffsetinsecs":0,"durationinsecs":275.333,"tempfilename":"C:\\Users\\EMartin\\AppData\\Local\\Temp\\V~44129925900101"}.

Is this a bug or limited feature ?

Thanks.


Esteban

Offline

Board footer

Powered by FluxBB