Added Check on directory for artwork

This commit is contained in:
Roy 2024-02-01 04:49:45 -08:00 committed by GitHub
parent a4ab23146f
commit 3d2d808a03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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