From 3d2d808a039b5e741ced73fafe224fc6b8faeb2b Mon Sep 17 00:00:00 2001 From: Roy <88516395+moraroy@users.noreply.github.com> Date: Thu, 1 Feb 2024 04:49:45 -0800 Subject: [PATCH] Added Check on directory for artwork --- NSLGameScanner.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NSLGameScanner.py b/NSLGameScanner.py index a99df9d..78379d1 100644 --- a/NSLGameScanner.py +++ b/NSLGameScanner.py @@ -150,6 +150,11 @@ def download_artwork(game_id, api_key, art_type, shortcut_id, dimensions=None): else: filename = get_file_name(art_type, shortcut_id) file_path = f"{logged_in_home}/.steam/root/userdata/{steamid3}/config/grid/{filename}" + + directory = os.path.dirname(file_path) + if not os.path.exists(directory): + os.makedirs(directory) + if os.path.exists(file_path): print(f"Artwork for {game_id} already exists. Skipping download.") return