From 57d88b2db4c8e725f4ff3c7854c54d3fc1e2de2d Mon Sep 17 00:00:00 2001 From: derrod Date: Wed, 8 Dec 2021 00:44:24 +0100 Subject: [PATCH] [core] Fix non-threaded metadata updates --- legendary/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/legendary/core.py b/legendary/core.py index 41f2b96..9727c41 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -417,8 +417,10 @@ class LegendaryCore: game = Game(app_name=app_name, app_title=eg_meta['title'], metadata=eg_meta, asset_infos=assets[app_name]) self.lgd.set_game_meta(game.app_name, game) games[app_name] = game + still_needs_update.remove(app_name) # setup and teardown of thread pool takes some time, so only do it when it makes sense. + still_needs_update = {e[0] for e in fetch_list} use_threads = len(fetch_list) > 5 if fetch_list: self.log.info(f'Fetching metadata for {len(fetch_list)} app(s).') @@ -432,7 +434,7 @@ class LegendaryCore: game = games.get(app_name) # retry if metadata is still missing/threaded loading wasn't used - if not game: + if not game or app_name in still_needs_update: if use_threads: self.log.warning(f'Fetching metadata for {app_name} failed, retrying') _ga = next(iter(app_assets.values()))