From 1c8349a28e14d31e4a5b134579180a6fa15510a6 Mon Sep 17 00:00:00 2001 From: derrod Date: Fri, 3 Dec 2021 17:14:45 +0100 Subject: [PATCH] [core] Do not show fetching metadata message unless there's data to fetch --- legendary/core.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 6680e3e..adc4606 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -420,10 +420,11 @@ class LegendaryCore: # setup and teardown of thread pool takes some time, so only do it when it makes sense. use_threads = len(fetch_list) > 5 - self.log.info(f'Fetching metadata for {len(fetch_list)} apps.') - if use_threads: - with ThreadPoolExecutor(max_workers=16) as executor: - executor.map(fetch_game_meta, fetch_list, timeout=60.0) + if fetch_list: + self.log.info(f'Fetching metadata for {len(fetch_list)} apps.') + if use_threads: + with ThreadPoolExecutor(max_workers=16) as executor: + executor.map(fetch_game_meta, fetch_list, timeout=60.0) for app_name, app_assets in sorted(assets.items()): if skip_ue and any(v.namespace == 'ue' for v in app_assets.values()):