Hi, I'm trying to get the path for the game images used per game in LaunchBox.
I assume I need to look through LaunchBox.Metadata.db to do this...
My results seems be this guid-looking-filename which doesn't exist on disk.
Is the approach correct or is there a better method to getting this data?
import sqlite3
db_path = r"C:\Users\HP\LaunchBox\Metadata\LaunchBox.Metadata.db"
conn = sqlite3.connect(db_path)
def check_game_images(conn, platform_name):
cursor = conn.cursor()
query = """
SELECT g.Name, gi.FileName, gi.Type, gi.Region
FROM GameImages gi
JOIN Games g ON g.DatabaseID = gi.DatabaseId
WHERE g.Platform = ?
"""
cursor.execute(query, (platform_name,))
results = cursor.fetchall()
if results:
for result in results:
game_name = result[0]
file_name = result[1]
image_type = result[2]
region = result[3] if result[3] else "Unknown"
print(f"Game: {game_name}")
print(f"Image FileName: {file_name}")
print(f"Image Type: {image_type}")
print(f"Region: {region}")
print("-" * 40)
else:
print(f"No images found for platform '{platform_name}' in the GameImages table.")
check_game_images(conn, "Nintendo Entertainment System")
conn.close()
My results look like
Game: Zelda II: The Adventure of Link
Image FileName: 340d97ea-ad0e-4801-9b53-479df72f9f11.png
Image Type: Clear Logo
Region: World
Where the filename should be:
Zelda II_ The Adventure of Link-01.png
Thanks!!