mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[core] Fix non-threaded metadata updates
This commit is contained in:
parent
6106433153
commit
57d88b2db4
|
@ -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])
|
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)
|
self.lgd.set_game_meta(game.app_name, game)
|
||||||
games[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.
|
# 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
|
use_threads = len(fetch_list) > 5
|
||||||
if fetch_list:
|
if fetch_list:
|
||||||
self.log.info(f'Fetching metadata for {len(fetch_list)} app(s).')
|
self.log.info(f'Fetching metadata for {len(fetch_list)} app(s).')
|
||||||
|
@ -432,7 +434,7 @@ class LegendaryCore:
|
||||||
|
|
||||||
game = games.get(app_name)
|
game = games.get(app_name)
|
||||||
# retry if metadata is still missing/threaded loading wasn't used
|
# 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:
|
if use_threads:
|
||||||
self.log.warning(f'Fetching metadata for {app_name} failed, retrying')
|
self.log.warning(f'Fetching metadata for {app_name} failed, retrying')
|
||||||
_ga = next(iter(app_assets.values()))
|
_ga = next(iter(app_assets.values()))
|
||||||
|
|
Loading…
Reference in a new issue