Handle input for single understood language

main
Bob Mottram 2022-02-25 15:13:23 +00:00
parent 8c54b72905
commit 4c9ddc3d4b
1 changed files with 9 additions and 3 deletions

View File

@ -51,8 +51,11 @@ def set_actor_languages(base_dir: str, actor_json: {},
languages_str: str) -> None:
"""Sets the languages used by the given actor
"""
languages_str = languages_str.strip()
separator = None
if ',' in languages_str:
separator = ','
if '/' in languages_str:
elif '/' in languages_str:
separator = '/'
elif ',' in languages_str:
separator = ','
@ -62,7 +65,10 @@ def set_actor_languages(base_dir: str, actor_json: {},
separator = '+'
elif ' ' in languages_str:
separator = ' '
if separator:
lang_list = languages_str.lower().split(separator)
else:
lang_list = [languages_str.lower()]
lang_list2 = ''
for lang in lang_list:
lang = lang.strip()