If a tag start with _, it is removed when looking in a tag_template, but not in a tags cups

This commit is contained in:
Faraphel 2022-08-28 11:49:24 +02:00
parent c12f517311
commit 0864ff1e05
2 changed files with 6 additions and 11 deletions

View file

@ -64,25 +64,15 @@
"prefix": {
"Wii": "{{ get_color(name='azure') @ tag }}",
"Switch": "{{ get_color(name='vivid red') @ tag }}",
"_Switch": "{{ get_color(name='vivid red') @ 'Switch' }}",
"3DS": "{{ get_color(name='light orange') @ tag }}",
"_3DS": "{{ get_color(name='light orange') @ '3DS' }}",
"DS": "{{ get_color(name='white') @ tag }}",
"_DS": "{{ get_color(name='white') @ 'DS' }}",
"GCN": "{{ get_color(name='azure') @ tag }}",
"_GCN": "{{ get_color(name='azure') @ 'GCN' }}",
"GBA": "{{ get_color(name='dark blue') @ tag }}",
"_GBA": "{{ get_color(name='dark blue') @ 'GBA' }}",
"N64": "{{ get_color(name='pink') @ tag }}",
"_N64": "{{ get_color(name='pink') @ 'N64' }}",
"SNES": "{{ get_color(name='green') @ tag }}",
"_SNES": "{{ get_color(name='green') @ 'SNES' }}",
"RMX": "{{ get_color(name='orange') @ tag }}",
"_RMX": "{{ get_color(name='orange') @ 'RMX' }}",
"MKT": "{{ get_color(name='dark orange') @ tag }}",
"_MKT": "{{ get_color(name='dark orange') @ 'MKT' }}",
"GP": "{{ get_color(name='dark red') @ tag }}",
"_GP": "{{ get_color(name='dark red') @ 'GP' }}",
"MSRDS": "{{ get_color(name='green') @ tag }}",
"CTR": "{{ get_color(name='orange') @ tag }}",

View file

@ -22,7 +22,12 @@ class RealArenaTrack:
:param default: default value if no tag template is found
:return: formatted representation of the tag
"""
for tag in filter(lambda tag: tag in self.mod_config.tags_templates[template_name], self.tags):
for tag in self.tags:
# if the tag start with an underscore (for example _3DS), it will be found in a get_tag_template,
# but ignored in the tags_cups list
tag = tag.removeprefix("_")
if tag not in self.mod_config.tags_templates[template_name]: continue
return self.mod_config.multiple_safe_eval(
template=self.mod_config.tags_templates[template_name][tag],
args=["tag"],