[15] fix replacing flags using the language overlay

pull/1269/head
meisnate12 2 years ago
parent 765863f6f7
commit f60bcefcac

@ -1 +1 @@
1.18.2-develop14 1.18.2-develop15

@ -38,7 +38,7 @@ external_templates:
country_<<key>>: <<country>> country_<<key>>: <<country>>
offset: 10 offset: 10
queue: flags queue: flags
pmm: flag/<<final_style>>/<<country_<<key>>>> pmm_<<key>>: flag/<<final_style>>/<<country_<<key>>>>
addon_position: <<final_align>> addon_position: <<final_align>>
addon_offset: <<offset>> addon_offset: <<offset>>
back_color: "#00000099" back_color: "#00000099"

@ -488,21 +488,26 @@ class DataFile:
return og_txt return og_txt
if _debug: if _debug:
logger.trace(f"Start {_method}: {_data}") logger.trace(f"Start {_method}: {_data}")
for i_check in range(8): try:
for option in optional: for i_check in range(8):
if option not in variables and option not in translation_variables and f"<<{option}>>" in str(_data): for option in optional:
if _debug: if option not in variables and option not in translation_variables and f"<<{option}>>" in str(_data):
logger.trace(f"Failed {_method}: {_data}") if _debug:
raise Failed logger.trace(f"Failed {_method}: {_data}")
for variable, variable_data in variables.items(): raise Failed
if (variable == "collection_name" or variable == "playlist_name") and _method in ["radarr_tag", "item_radarr_tag", "sonarr_tag", "item_sonarr_tag"]: for variable, variable_data in variables.items():
_data = scan_text(_data, variable, variable_data.replace(",", "")) if (variable == "collection_name" or variable == "playlist_name") and _method in ["radarr_tag", "item_radarr_tag", "sonarr_tag", "item_sonarr_tag"]:
elif variable != "name": _data = scan_text(_data, variable, variable_data.replace(",", ""))
elif variable != "name":
_data = scan_text(_data, variable, variable_data)
for variable, variable_data in translation_variables.items():
_data = scan_text(_data, variable, variable_data) _data = scan_text(_data, variable, variable_data)
for variable, variable_data in translation_variables.items(): for dm, dd in default.items():
_data = scan_text(_data, variable, variable_data) _data = scan_text(_data, dm, dd)
for dm, dd in default.items(): except Failed:
_data = scan_text(_data, dm, dd) if _debug:
logger.trace(f"Failed {_method}: {_data}")
raise
if _debug: if _debug:
logger.trace(f"End {_method}: {_data}") logger.trace(f"End {_method}: {_data}")
return _data return _data

Loading…
Cancel
Save