Update NSLGameScanner.py

This commit is contained in:
Roy 2024-12-25 15:22:56 -08:00 committed by GitHub
parent 148e0cb9bb
commit 2f200aefb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1329,20 +1329,25 @@ else:
# List to store final Itch.io game details # List to store final Itch.io game details
itchgames = [] itchgames = []
# Match game_id between 'caves' and 'games' tables and collect relevant game details # Match game_id between 'caves' and 'games' tables
itchgames = []
for cave in caves: for cave in caves:
game_id = cave[1] game_id = cave[1]
if game_id in games_dict: if game_id in games_dict:
game_info = games_dict[game_id] game_info = games_dict[game_id]
cave_info = json.loads(cave[11]) base_path = json.loads(cave[11])['basePath']
base_path = cave_info['basePath'] candidates = json.loads(cave[11])['candidates']
candidates = cave_info['candidates']
executable_path = candidates[0]['path']
# Skip games with an executable that ends with '.html' (browser games) if candidates and isinstance(candidates, list) and len(candidates) > 0:
if executable_path.endswith('.html'): executable_path = candidates[0].get('path')
if executable_path and executable_path.endswith('.html'):
print(f"Skipping browser game: {game_info[2]}") print(f"Skipping browser game: {game_info[2]}")
continue continue
game_title = game_info[2]
itchgames.append((base_path, executable_path, game_title))
else:
print(f"No candidates found for game: {game_info[2]}")
# Extract the game title # Extract the game title
game_title = game_info[2] game_title = game_info[2]