support the new format for supported_languages

This commit is contained in:
otavepto 2024-02-16 15:57:52 +02:00
parent 3a701dfbbd
commit e62ec772c3
2 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,5 @@
* generate_emu_config: allow setting the steam id of apps/games owners from an external file `top_owners_ids.txt` beside the script
* generate_emu_config: support the new format for `supported_languages`
* generate_emu_config: always use the directory of the script for: the data `backup` folder, the `login_temp` folder, the `my_login.txt` file
---

View File

@ -732,8 +732,11 @@ def main():
achievements = generate_achievement_stats(client, appid, emu_settings_dir, backup_dir)
if "supported_languages" in game_info_common:
langs : dict[str, dict] = game_info_common["supported_languages"]
languages = [lang for lang in langs if langs[lang].get("supported", "").lower() == "true"]
langs: dict[str, dict] = game_info_common["supported_languages"]
for lang in langs:
support: str = langs[lang].get("supported", "").lower()
if support == "true" or support == "1":
languages.append(lang)
if languages:
with open(os.path.join(emu_settings_dir, "supported_languages.txt"), 'wt', encoding='utf-8') as f: