From 4bed49e7e1ef8350264277a9cbe049fe30a16adc Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 28 May 2023 00:08:39 +0200 Subject: [PATCH] [core] Ignore KeyError when updating game info The retry logic may attempt to update metadata for an asset for a different platform. This can cause an exception if it's not also in the "still_needs_update" set. --- legendary/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/legendary/core.py b/legendary/core.py index 838bb33..bd3ad7d 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -439,7 +439,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) + try: + still_needs_update.remove(app_name) + except KeyError: + pass # 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}