Open frifix opened 1 month ago
looks there's a problem when initializing after loading an advanced template preset could be related to #204 ?
looks there's a problem when initializing after loading an advanced template preset could be related to #204 ?
Not sure because in my case, I have the same bug but the source_template is still there in the configuration :
"ccd5c15f-5d66-44e8-b1ef-a0dfcd0c42ce": {
"name": "Reading Audio Yomitan",
"source": {
"mode": "advanced_template",
"source_field": null,
"source_template": "front = template_fields['Front']\nif front:\n result = front\nelse:\n result = template_fields['Reading']",
"template_format_version": "v1",
"use_selection": false
},
"target": {
"remove_sound_tag": true,
"target_field": "Audio",
"text_and_sound_tag": false
},
"text_processing": {
"html_to_text_line": true,
"ignore_case": false,
"run_replace_rules_after": true,
"ssml_convert_characters": true,
"strip_brackets": false,
"text_replacement_rules": [
{
"rule_type": "Simple",
"source": "(",
"target": ""
},
{
"rule_type": "Simple",
"source": ")",
"target": ""
}
]
},
Hi,
I have flash cards like this: Front:
I don't usualy eat [[ podwieczorek ]]
Back:afternoon tea
I have created an advanced template in HyperTTS that replace the word in [[ ]] brackets with the word that is on the back. Here it's my advanced template script:
For some reason when I want to add a sound it doesn't work properly for the first time, it shows an error:
When I click "Show Settings" and click on "Note Id" it says:
Error: No "result" variable found. You must assign the final template output to a result variable.
When I change something in the script (e.g. remove one letter and add it again) then the whole script will be loaded again and the error no longer appears:
It is very annoying that I have to do this every time when I want to add sounds for my flash cards. It would be great if this problem could be solved.